Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bindings/matrix-sdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ matrix-sdk = { workspace = true, features = [
"markdown",
"socks",
"uniffi",
"federation-api",
] }
matrix-sdk-base.workspace = true
matrix-sdk-common.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/matrix-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file.

### Refactor

- [**breaking**]: `Client::server_vendor_info()` requires to enable the
`federation-api` feature.
([#5912](https://github.com/matrix-org/matrix-rust-sdk/pull/5912))
- [**breaking**]: `Client::reset_server_info()` has been split into
`reset_supported_versions()` and `reset_well_known()`.
([#5910](https://github.com/matrix-org/matrix-rust-sdk/pull/5910))
Expand Down
5 changes: 3 additions & 2 deletions crates/matrix-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ rustls-tls = ["reqwest/rustls-tls"]
socks = ["reqwest/socks"]
local-server = ["dep:axum", "dep:rand", "dep:tower"]
sso-login = ["local-server"]
# Enable methods that make calls to the federation API.
federation-api = ["ruma/federation-api-c"]

uniffi = ["dep:uniffi", "matrix-sdk-base/uniffi", "dep:matrix-sdk-ffi-macros"]

experimental-widgets = ["dep:uuid", "experimental-send-custom-to-device"]

docsrs = ["e2e-encryption", "sqlite", "indexeddb", "sso-login", "qrcode"]
docsrs = ["e2e-encryption", "sqlite", "indexeddb", "sso-login", "qrcode", "federation-api"]

# Add support for inline media galleries via msgtypes
unstable-msc4274 = ["ruma/unstable-msc4274", "matrix-sdk-base/unstable-msc4274"]
Expand Down Expand Up @@ -116,7 +118,6 @@ pin-project-lite.workspace = true
rand = { workspace = true, optional = true }
ruma = { workspace = true, features = [
"rand",
"federation-api-c",
"unstable-msc2448",
"unstable-msc4191",
"unstable-msc3930",
Expand Down
4 changes: 3 additions & 1 deletion crates/matrix-sdk/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ use ruma::{
user_directory::search_users,
},
error::FromHttpResponseError,
federation::discovery::get_server_version,
path_builder::PathBuilder,
},
assign,
Expand Down Expand Up @@ -604,10 +603,13 @@ impl Client {
/// );
/// # anyhow::Ok(()) };
/// ```
#[cfg(feature = "federation-api")]
pub async fn server_vendor_info(
&self,
request_config: Option<RequestConfig>,
) -> HttpResult<ServerVendorInfo> {
use ruma::api::federation::discovery::get_server_version;

let res = self
.send_inner(get_server_version::v1::Request::new(), request_config, Default::default())
.await?;
Expand Down
2 changes: 2 additions & 0 deletions crates/matrix-sdk/tests/integration/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ async fn test_room_sync_state_after() {
assert_eq!(*member.membership(), MembershipState::Leave);
}

#[cfg(feature = "federation-api")]
#[async_test]
async fn test_server_vendor_info() {
let server = MatrixMockServer::new().await;
Expand Down Expand Up @@ -1567,6 +1568,7 @@ async fn test_server_version_without_auth() {
.expect("We should not fail here since we did not provide an auth token.");
}

#[cfg(feature = "federation-api")]
#[async_test]
async fn test_server_vendor_info_with_missing_fields() {
let server = MatrixMockServer::new().await;
Expand Down
Loading