events: Add StrippedPowerLevelsEvent::power_levels

This commit is contained in:
Jonas Platte 2022-05-02 16:25:28 +02:00
parent e479d2db05
commit 80dae90925
No known key found for this signature in database
GPG Key ID: BBA95679259D342F

View File

@ -191,6 +191,13 @@ impl SyncRoomPowerLevelsEvent {
} }
} }
impl StrippedRoomPowerLevelsEvent {
/// Obtain the effective power levels from this event.
pub fn power_levels(&self) -> RoomPowerLevels {
self.content.clone().into()
}
}
/// The effective power levels of a room. /// The effective power levels of a room.
/// ///
/// This struct contains the same fields as [`RoomPowerLevelsEventContent`] and be created from that /// This struct contains the same fields as [`RoomPowerLevelsEventContent`] and be created from that