Skip to content

Commit

Permalink
feat(ffi): add room history visibility to the FFI RoomInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinesp committed Dec 11, 2024
1 parent 0d01893 commit 15d2db1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bindings/matrix-sdk-ffi/src/room_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tracing::warn;
use crate::{
client::JoinRule,
notification_settings::RoomNotificationMode,
room::{Membership, RoomHero},
room::{Membership, RoomHero, RoomHistoryVisibility},
room_member::RoomMember,
};

Expand Down Expand Up @@ -60,6 +60,8 @@ pub struct RoomInfo {
pinned_event_ids: Vec<String>,
/// The join rule for this room, if known.
join_rule: Option<JoinRule>,
/// The history visibility for this room, if known.
history_visibility: Option<RoomHistoryVisibility>,
}

impl RoomInfo {
Expand Down Expand Up @@ -128,6 +130,7 @@ impl RoomInfo {
num_unread_mentions: room.num_unread_mentions(),
pinned_event_ids,
join_rule: join_rule.ok(),
history_visibility: room.history_visibility().and_then(|h| h.try_into().ok()),
})
}
}

0 comments on commit 15d2db1

Please sign in to comment.