matrix-sdk: add method to check room's event visibility
parent
0fb3dedd1c
commit
092ca90403
|
@ -7,6 +7,7 @@ use ruma::{
|
||||||
membership::{get_member_events, join_room_by_id, leave_room},
|
membership::{get_member_events, join_room_by_id, leave_room},
|
||||||
message::get_message_events,
|
message::get_message_events,
|
||||||
},
|
},
|
||||||
|
events::room::history_visibility::HistoryVisibility,
|
||||||
UserId,
|
UserId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,6 +177,17 @@ impl Common {
|
||||||
Ok(())
|
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.
|
/// Sync the member list with the server.
|
||||||
///
|
///
|
||||||
/// This method will de-duplicate requests if it is called multiple times in
|
/// This method will de-duplicate requests if it is called multiple times in
|
||||||
|
|
Loading…
Reference in New Issue