client-api: Add support for media download redirects

According to MSC3860
This commit is contained in:
Kévin Commaille 2023-05-24 17:24:38 +02:00 committed by Kévin Commaille
parent 0b390cc3c9
commit 93ae0a3379
4 changed files with 28 additions and 0 deletions

View File

@ -10,6 +10,7 @@ Improvements:
- Add convenience constructors for enabling lazy-loading in filters
- Add support for using an existing session to log in another (MSC3882 / Matrix 1.7)
- Add support for media download redirects (MSC3860 / Matrix 1.7)
# 0.16.2

View File

@ -65,6 +65,14 @@ pub mod v3 {
rename = "fi.mau.msc2246.max_stall_ms"
)]
pub timeout_ms: Duration,
/// Whether the server may return a 307 or 308 redirect response that points at the
/// relevant media content.
///
/// Unless explicitly set to `true`, the server must return the media content itself.
#[ruma_api(query)]
#[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
pub allow_redirect: bool,
}
/// Response type for the `get_media_content` endpoint.
@ -105,6 +113,7 @@ pub mod v3 {
allow_remote: true,
#[cfg(feature = "unstable-msc2246")]
timeout_ms: crate::media::default_download_timeout(),
allow_redirect: false,
}
}

View File

@ -69,6 +69,14 @@ pub mod v3 {
rename = "fi.mau.msc2246.max_stall_ms"
)]
pub timeout_ms: Duration,
/// Whether the server may return a 307 or 308 redirect response that points at the
/// relevant media content.
///
/// Unless explicitly set to `true`, the server must return the media content itself.
#[ruma_api(query)]
#[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
pub allow_redirect: bool,
}
/// Response type for the `get_media_content_as_filename` endpoint.
@ -110,6 +118,7 @@ pub mod v3 {
allow_remote: true,
#[cfg(feature = "unstable-msc2246")]
timeout_ms: crate::media::default_download_timeout(),
allow_redirect: false,
}
}

View File

@ -85,6 +85,14 @@ pub mod v3 {
rename = "fi.mau.msc2246.max_stall_ms"
)]
pub timeout_ms: Duration,
/// Whether the server may return a 307 or 308 redirect response that points at the
/// relevant media content.
///
/// Unless explicitly set to `true`, the server must return the media content itself.
#[ruma_api(query)]
#[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
pub allow_redirect: bool,
}
/// Response type for the `get_content_thumbnail` endpoint.
@ -125,6 +133,7 @@ pub mod v3 {
allow_remote: true,
#[cfg(feature = "unstable-msc2246")]
timeout_ms: crate::media::default_download_timeout(),
allow_redirect: false,
}
}