matrix-sdk: add method to check room's event visibility

master
SaurusXI 2021-06-20 12:24:40 +05:30
parent 0fb3dedd1c
commit 092ca90403
No known key found for this signature in database
GPG Key ID: 443CCBEAA2C0E87E
1 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@ use ruma::{
membership::{get_member_events, join_room_by_id, leave_room},
message::get_message_events,
},
events::room::history_visibility::HistoryVisibility,
UserId,
};
@ -176,6 +177,17 @@ impl Common {
Ok(())
}
fn are_events_visible(&self) -> bool {
if let RoomType::Invited = self.inner.room_type() {
match self.inner.history_visibility() {
HistoryVisibility::WorldReadable | HistoryVisibility::Shared => true,
_ => false,
}
}
true
}
/// Sync the member list with the server.
///
/// This method will de-duplicate requests if it is called multiple times in