Skip to content
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

Process rooms' read status client-side #2953

Merged
merged 10 commits into from
Dec 21, 2023
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions bindings/matrix-sdk-ffi/src/room_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ pub struct RoomInfo {
user_defined_notification_mode: Option<RoomNotificationMode>,
has_room_call: bool,
active_room_call_participants: Vec<String>,
/// "Interesting" messages received in that room, independently of the
/// notification settings.
num_unread_messages: u64,
/// Events that will notify the user, according to their
/// notification settings.
num_unread_notifications: u64,
/// Events causing mentions/highlights for the user, according to their
/// notification settings.
num_unread_mentions: u64,
}

impl RoomInfo {
Expand Down Expand Up @@ -75,6 +84,9 @@ impl RoomInfo {
.iter()
.map(|u| u.to_string())
.collect(),
num_unread_messages: room.num_unread_messages(),
num_unread_notifications: room.num_unread_notifications(),
num_unread_mentions: room.num_unread_mentions(),
})
}
}
1 change: 1 addition & 0 deletions crates/matrix-sdk-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ assert_matches2 = { workspace = true, optional = true }
async-trait = { workspace = true }
bitflags = "2.1.0"
eyeball = { workspace = true }
eyeball-im = { workspace = true }
futures-util = { workspace = true }
http = { workspace = true, optional = true }
matrix-sdk-common = { version = "0.6.0", path = "../matrix-sdk-common" }
Expand Down
6 changes: 6 additions & 0 deletions crates/matrix-sdk-base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ mod error;
pub mod latest_event;
pub mod media;
mod rooms;

#[cfg(feature = "experimental-sliding-sync")]
mod read_receipts;
#[cfg(feature = "experimental-sliding-sync")]
pub use read_receipts::PreviousEventsProvider;
#[cfg(feature = "experimental-sliding-sync")]
mod sliding_sync;

pub mod store;
pub mod sync;
mod utils;
Expand Down
Loading