mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-13 02:25:51 -04:00
matrix-sdk: add method to check room's event visibility
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user