Add unstable support for discovering a sliding sync proxy (MSC3575)

This commit is contained in:
Doug 2023-01-24 19:53:22 +00:00 committed by GitHub
parent 06820cdc92
commit 47450cecc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -31,6 +31,7 @@ Improvements:
* Send CORP headers by default for media responses (MSC3828 / Matrix 1.4) * Send CORP headers by default for media responses (MSC3828 / Matrix 1.4)
* Add support for read receipts for threads (MSC3771 / Matrix 1.4) * Add support for read receipts for threads (MSC3771 / Matrix 1.4)
* Add unstable support to get an event by timestamp (MSC3030) * Add unstable support to get an event by timestamp (MSC3030)
* Add unstable support for discovering a sliding sync proxy (MSC3575)
# 0.15.3 # 0.15.3

View File

@ -52,6 +52,11 @@ pub struct Response {
skip_serializing_if = "Option::is_none" skip_serializing_if = "Option::is_none"
)] )]
pub authentication: Option<AuthenticationServerInfo>, pub authentication: Option<AuthenticationServerInfo>,
/// Information about the homeserver's trusted proxy to use for sliding sync development.
#[cfg(feature = "unstable-msc3575")]
#[serde(rename = "org.matrix.msc3575.proxy", skip_serializing_if = "Option::is_none")]
pub sliding_sync_proxy: Option<SlidingSyncProxyInfo>,
} }
impl Request { impl Request {
@ -71,6 +76,8 @@ impl Response {
tile_server: None, tile_server: None,
#[cfg(feature = "unstable-msc2965")] #[cfg(feature = "unstable-msc2965")]
authentication: None, authentication: None,
#[cfg(feature = "unstable-msc3575")]
sliding_sync_proxy: None,
} }
} }
} }
@ -140,8 +147,25 @@ pub struct AuthenticationServerInfo {
#[cfg(feature = "unstable-msc2965")] #[cfg(feature = "unstable-msc2965")]
impl AuthenticationServerInfo { impl AuthenticationServerInfo {
/// Creates an `AuthenticationServerInfo` with the given `issuer` and an optional `account. /// Creates an `AuthenticationServerInfo` with the given `issuer` and an optional `account`.
pub fn new(issuer: String, account: Option<String>) -> Self { pub fn new(issuer: String, account: Option<String>) -> Self {
Self { issuer, account } Self { issuer, account }
} }
} }
/// Information about a discovered sliding sync proxy.
#[cfg(feature = "unstable-msc3575")]
#[derive(Clone, Debug, Deserialize, Hash, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct SlidingSyncProxyInfo {
/// The URL of a sliding sync proxy that is trusted by the homeserver.
pub url: String,
}
#[cfg(feature = "unstable-msc3575")]
impl SlidingSyncProxyInfo {
/// Creates a `SlidingSyncProxyInfo` with the given proxy URL.
pub fn new(url: String) -> Self {
Self { url }
}
}