Skip to content

Commit 4b1ae06

Browse files
danderson-contstefanceriu
authored andcommitted
feat(base): add FULLY_READ notable update reason
Add `RoomInfoNotableUpdateReasons::FULLY_READ`, used for when the `m.fully_read` marker for a room changes. Breaking change: the backing bitflag widens from `u8` to `u16` for the new flag to not alter the existing bit positions. Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
1 parent 4a26af8 commit 4b1ae06

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[**breaking**] `RoomInfoNotableUpdateReasons` is now a `u16` to include a `FULLY_READ` flag to notify on changes of the `m.fully_read` marker.

crates/matrix-sdk-base/src/room/room_info.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,27 +1412,27 @@ pub struct RoomInfoNotableUpdate {
14121412
bitflags! {
14131413
/// The reason why a [`RoomInfoNotableUpdate`] is emitted.
14141414
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
1415-
pub struct RoomInfoNotableUpdateReasons: u8 {
1415+
pub struct RoomInfoNotableUpdateReasons: u16 {
14161416
/// The recency stamp of the `Room` has changed.
1417-
const RECENCY_STAMP = 0b0000_0001;
1417+
const RECENCY_STAMP = 0b0000_0000_0000_0001;
14181418

14191419
/// The latest event of the `Room` has changed.
1420-
const LATEST_EVENT = 0b0000_0010;
1420+
const LATEST_EVENT = 0b0000_0000_0000_0010;
14211421

14221422
/// A read receipt has changed.
1423-
const READ_RECEIPT = 0b0000_0100;
1423+
const READ_RECEIPT = 0b0000_0000_0000_0100;
14241424

14251425
/// The user-controlled unread marker value has changed.
1426-
const UNREAD_MARKER = 0b0000_1000;
1426+
const UNREAD_MARKER = 0b0000_0000_0000_1000;
14271427

14281428
/// A membership change happened for the current user.
1429-
const MEMBERSHIP = 0b0001_0000;
1429+
const MEMBERSHIP = 0b0000_0000_0001_0000;
14301430

14311431
/// The display name has changed.
1432-
const DISPLAY_NAME = 0b0010_0000;
1432+
const DISPLAY_NAME = 0b0000_0000_0010_0000;
14331433

14341434
/// The active service members have changed.
1435-
const ACTIVE_SERVICE_MEMBERS = 0b0100_0000;
1435+
const ACTIVE_SERVICE_MEMBERS = 0b0000_0000_0100_0000;
14361436

14371437
/// This is a temporary hack.
14381438
///
@@ -1444,7 +1444,10 @@ bitflags! {
14441444
/// identified, we are likely to miss particular updates, and it can feel broken.
14451445
/// Ultimately, we want to clearly identify all the notable update reasons, and
14461446
/// remove this one.
1447-
const NONE = 0b1000_0000;
1447+
const NONE = 0b0000_0000_1000_0000;
1448+
1449+
/// The user's `m.fully_read` marker has changed.
1450+
const FULLY_READ = 0b0000_0001_0000_0000;
14481451
}
14491452
}
14501453

0 commit comments

Comments
 (0)