matrix-sdk: add method to check room's event visibility
@@ -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
