mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-07 07:27:45 -04:00
Merge branch 'room-is-space'
This commit is contained in:
@@ -26,8 +26,11 @@ use ruma::{
|
||||
events::{
|
||||
receipt::Receipt,
|
||||
room::{
|
||||
create::CreateEventContent, encryption::EncryptionEventContent,
|
||||
guest_access::GuestAccess, history_visibility::HistoryVisibility, join_rules::JoinRule,
|
||||
create::{CreateEventContent, RoomType as CreateRoomType},
|
||||
encryption::EncryptionEventContent,
|
||||
guest_access::GuestAccess,
|
||||
history_visibility::HistoryVisibility,
|
||||
join_rules::JoinRule,
|
||||
tombstone::TombstoneEventContent,
|
||||
},
|
||||
tag::Tags,
|
||||
@@ -130,6 +133,14 @@ impl Room {
|
||||
self.inner.read().unwrap().room_type
|
||||
}
|
||||
|
||||
/// Whether this room's [`RoomType`](CreateRoomType) is `m.space`.
|
||||
pub fn is_space(&self) -> bool {
|
||||
match self.inner.read().unwrap().base_info.create.as_ref() {
|
||||
Some(create) => create.room_type == Some(CreateRoomType::Space),
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the unread notification counts.
|
||||
pub fn unread_notification_counts(&self) -> UnreadNotificationsCount {
|
||||
self.inner.read().unwrap().notification_counts
|
||||
|
||||
Reference in New Issue
Block a user