base: Add a method to check if the room is public.

master
Damir Jelić 2021-01-04 18:26:53 +01:00
parent 76ce3fecb3
commit 22b13c369b
1 changed files with 4 additions and 0 deletions

View File

@ -162,6 +162,10 @@ impl Room {
.clone() .clone()
} }
pub fn is_public(&self) -> bool {
matches!(self.joine_rules(), JoinRule::Public)
}
pub fn joine_rules(&self) -> JoinRule { pub fn joine_rules(&self) -> JoinRule {
self.inner.read().unwrap().base_info.join_rule.clone() self.inner.read().unwrap().base_info.join_rule.clone()
} }