events: Add {RoomGuestAccessEvent, SyncRoomGuestAccessEvent}::guest_access
This commit is contained in:
parent
ea832d0c45
commit
cfc5c6e88f
@ -28,6 +28,26 @@ impl RoomGuestAccessEventContent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl RoomGuestAccessEvent {
|
||||||
|
/// Obtain the guest access policy, regardless of whether this event is redacted.
|
||||||
|
pub fn guest_access(&self) -> &GuestAccess {
|
||||||
|
match self {
|
||||||
|
Self::Original(ev) => &ev.content.guest_access,
|
||||||
|
Self::Redacted(_) => &GuestAccess::Forbidden,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SyncRoomGuestAccessEvent {
|
||||||
|
/// Obtain the guest access policy, regardless of whether this event is redacted.
|
||||||
|
pub fn guest_access(&self) -> &GuestAccess {
|
||||||
|
match self {
|
||||||
|
Self::Original(ev) => &ev.content.guest_access,
|
||||||
|
Self::Redacted(_) => &GuestAccess::Forbidden,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A policy for guest user access to a room.
|
/// A policy for guest user access to a room.
|
||||||
#[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))]
|
#[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user