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/changelog.d/6726.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `SyncServiceBuilder::with_profiles_extension` to enable the Profiles sliding sync extension, which syncs global profile fields such as `m.status` and `m.call`.
10 changes: 10 additions & 0 deletions bindings/matrix-sdk-ffi/src/sync_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ impl SyncServiceBuilder {
Arc::new(Self { builder, ..this })
}

/// Enable the Profiles sliding sync extension for the room list service.
///
/// Required to merge the global `m.status` and `m.call` fields into the
/// room members and profiles read from the SDK.
Comment on lines +133 to +134

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear during review. This merge part isn't ready yet, but is being handled by #6704.

pub fn with_profiles_extension(self: Arc<Self>) -> Arc<Self> {
let this = unwrap_or_clone_arc(self);
let builder = this.builder.with_profiles_extension();
Arc::new(Self { builder, ..this })
}

/// Set a custom Sliding Sync connection ID for the room list service.
///
/// By default [`matrix_sdk_ui::room_list_service::DEFAULT_CONNECTION_ID`]
Expand Down
1 change: 1 addition & 0 deletions crates/matrix-sdk-ui/changelog.d/6726.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `SyncServiceBuilder::with_profiles_extension` to enable the Profiles sliding sync extension, which syncs global profile fields such as `m.status` and `m.call`.
15 changes: 14 additions & 1 deletion crates/matrix-sdk-ui/src/room_list_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ impl RoomListService {
/// to create one in this case using
/// [`EncryptionSyncService`][crate::encryption_sync_service::EncryptionSyncService].
pub async fn new(client: Client) -> Result<Self, Error> {
Self::new_with(client, true, DEFAULT_CONNECTION_ID, DEFAULT_LIST_TIMELINE_LIMIT).await
Self::new_with(client, true, DEFAULT_CONNECTION_ID, DEFAULT_LIST_TIMELINE_LIMIT, false)
.await
}

/// Like [`RoomListService::new`] but with additional configuration options.
Expand All @@ -150,13 +151,17 @@ impl RoomListService {
/// cross-process position sharing.
/// - `connection_id`: the Sliding Sync connection ID
/// - `timeline_limit`: the timeline limit
/// - `profiles_extension`: enables the Profiles extension, required to
/// merge the global `m.status` and `m.call` fields into room members and
/// profiles
///
/// [`SlidingSyncBuilder::share_pos`]: matrix_sdk::sliding_sync::SlidingSyncBuilder::share_pos
pub async fn new_with(
client: Client,
share_pos: bool,
connection_id: &str,
timeline_limit: u32,
profiles_extension: bool,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not terribly happy with how many arguments we now have here, but ok.

) -> Result<Self, Error> {
let mut builder = client
.sliding_sync(connection_id)
Expand Down Expand Up @@ -198,6 +203,14 @@ impl RoomListService {
}
}

if profiles_extension {
debug!("Enabling the profiles extension for the room list sliding sync");
builder = builder.with_profiles_extension(assign!(
http::request::Profiles::default(),
{ enabled: Some(true) }

@pixlwave pixlwave Jul 6, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR, I've opted not to include the fields filter in here for the moment – it seems worth waiting to see how much data we receive once we have a working backend to test against.

));
}

if share_pos {
// The e2ee extensions aren't enabled in this sliding sync instance, and this is
// the only one that could be used from a different process. So it's
Expand Down
19 changes: 19 additions & 0 deletions crates/matrix-sdk-ui/src/sync_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,13 @@ pub struct SyncServiceBuilder {
/// [`SlidingSyncBuilder::share_pos`]: matrix_sdk::sliding_sync::SlidingSyncBuilder::share_pos
with_share_pos: bool,

/// Whether to enable the Profiles sliding sync extension for the room list
/// service.
///
/// Required to merge the global `m.status` and `m.call` fields into the
/// room members and profiles read from this crate.
with_profiles_extension: bool,

/// Custom connection ID for the room list service.
/// Defaults to [`room_list_service::DEFAULT_CONNECTION_ID`]. Use a
/// different value for secondary processes such as iOS share extensions
Expand All @@ -799,6 +806,7 @@ impl SyncServiceBuilder {
client,
with_offline_mode: false,
with_share_pos: true,
with_profiles_extension: false,
room_list_conn_id: DEFAULT_CONNECTION_ID.to_owned(),
room_list_timeline_limit: DEFAULT_LIST_TIMELINE_LIMIT,
parent_span: Span::none(),
Expand All @@ -822,6 +830,15 @@ impl SyncServiceBuilder {
self
}

/// Enable the Profiles sliding sync extension for the room list service.
///
/// Required to merge the global `m.status` and `m.call` fields into the
/// room members and profiles read from this crate.
pub fn with_profiles_extension(mut self) -> Self {
self.with_profiles_extension = true;
self
}

/// Set a custom conn_id for the room list sliding sync connection.
pub fn with_room_list_conn_id(mut self, conn_id: String) -> Self {
self.room_list_conn_id = conn_id;
Expand Down Expand Up @@ -851,6 +868,7 @@ impl SyncServiceBuilder {
client,
with_offline_mode,
with_share_pos,
with_profiles_extension,
room_list_conn_id,
room_list_timeline_limit,
parent_span,
Expand All @@ -863,6 +881,7 @@ impl SyncServiceBuilder {
with_share_pos,
&room_list_conn_id,
room_list_timeline_limit,
with_profiles_extension,
)
.await?;

Expand Down
Loading