Skip to content

Commit bdb640a

Browse files
pixlwavepoljar
authored andcommitted
ffi: Expose a check for LiveKit RTC support.
1 parent ea28234 commit bdb640a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

bindings/matrix-sdk-ffi/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Breaking changes:
3939
- `RoomInfo` replaces its field `is_tombstoned: bool` with `tombstone: Option<RoomTombstoneInfo>`,
4040
containing the data needed to implement the room migration UI, a message and the replacement room id.
4141
([#5027](https://github.com/matrix-org/matrix-rust-sdk/pull/5027))
42+
- `Client::reset_server_capabilities` has been renamed to `Client::reset_server_info`.
4243

4344
Additions:
4445

bindings/matrix-sdk-ffi/src/client.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ use matrix_sdk::{
1919
},
2020
ruma::{
2121
api::client::{
22-
discovery::get_authorization_server_metadata::msc2965::Prompt as RumaOidcPrompt,
22+
discovery::{
23+
discover_homeserver::RtcFocusInfo,
24+
get_authorization_server_metadata::msc2965::Prompt as RumaOidcPrompt,
25+
},
2326
push::{EmailPusherData, PusherIds, PusherInit, PusherKind as RumaPusherKind},
2427
room::{create_room, Visibility},
2528
session::get_login_types,
@@ -1489,6 +1492,16 @@ impl Client {
14891492
Ok(self.inner.server_versions().await?.contains(&ruma::api::MatrixVersion::V1_13))
14901493
}
14911494

1495+
/// Checks if the server supports the LiveKit RTC focus for placing calls.
1496+
pub async fn is_livekit_rtc_supported(&self) -> Result<bool, ClientError> {
1497+
Ok(self
1498+
.inner
1499+
.rtc_foci()
1500+
.await?
1501+
.iter()
1502+
.any(|focus| matches!(focus, RtcFocusInfo::LiveKit(_))))
1503+
}
1504+
14921505
/// Subscribe to changes in the media preview configuration.
14931506
pub async fn subscribe_to_media_preview_config(
14941507
&self,

0 commit comments

Comments
 (0)