-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base): Revisit the
roominfo_update
API.
This patch updates several parts of the code but it's basically just renamings. First off, the patch renames `RoomInfoUpdate` to `RoomInfoNotableUpdate`. The functions, methods or variables whose names start with `roominfo_update(.*)` are renamed `room_info_notable_update$1`. Second, this patch removes the `RoomInfoNotableUpdate::trigger_room_list_update` field. It is replaced by a `reasons: RoomInfoNotableUpdateReasons` 8-bit unsigned integer, represented as an `enum` type. It addresses the following issues: 1. When a subscriber receives a `RoomInfoNotableUpdate`, they have no idea what has triggered this update. 2. In `matrix_sdk_base::sliding_sync::BaseClient::process_sliding_sync_e2ee`, we were triggering an update even if the latest event wasn't modified: it is a false-positive, it was a bug and a waste of resources. Now it's more refined, see the why below. Third, this patch removes the second `trigger_room_list_update` argument of `matrix_sdk_base::BaseClient::apply_changes`. This method now knows where to find the reasons for the room info notable updates, see next point. Fourth, this patch adds a new `matrix_sdk::StateChanges::room_info_notable_updates` field which is a B-tree map between an `OwnedRoomId` and a `RoomInfoNotableUpdateReasons`. The idea is that all places that receive a `StateChanges` can also create a room info notable update with a specific reason. This is a finer grained mechanism, and it avoids to pass new arguments everywhere. It's cleaner. Finally, it's easier than ever to add a new reason and to propagate it to subscribers.
- Loading branch information
Showing
14 changed files
with
191 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.