events: Add {RoomHistoryVisibilityEvent, SyncRoomHistoryVisibilityEvent}::history_visibility
This commit is contained in:
parent
16f2021c59
commit
ea832d0c45
@ -27,6 +27,26 @@ impl RoomHistoryVisibilityEventContent {
|
||||
}
|
||||
}
|
||||
|
||||
impl RoomHistoryVisibilityEvent {
|
||||
/// Obtain the history visibility, regardless of whether this event is redacted.
|
||||
pub fn history_visibility(&self) -> &HistoryVisibility {
|
||||
match self {
|
||||
Self::Original(ev) => &ev.content.history_visibility,
|
||||
Self::Redacted(ev) => &ev.content.history_visibility,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SyncRoomHistoryVisibilityEvent {
|
||||
/// Obtain the history visibility, regardless of whether this event is redacted.
|
||||
pub fn history_visibility(&self) -> &HistoryVisibility {
|
||||
match self {
|
||||
Self::Original(ev) => &ev.content.history_visibility,
|
||||
Self::Redacted(ev) => &ev.content.history_visibility,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Who can see a room's history.
|
||||
#[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user