-
Notifications
You must be signed in to change notification settings - Fork 454
Profiles: Allow building a sync service with support for the profiles extension. #6726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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`. |
| 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`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
|
@@ -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, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
@@ -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) } | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
There was a problem hiding this comment.
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.