feat(ffi): Add fn RoomPowerLevels::events

With this we can query the power level value for any event type
This commit is contained in:
Jorge Martín
2025-12-09 12:29:13 +01:00
committed by Jorge Martin Espinosa
parent b3f6df939b
commit 1f94e9d20c

View File

@@ -29,6 +29,10 @@ impl RoomPowerLevels {
self.inner.clone().into()
}
fn events(&self) -> HashMap<String, i64> {
self.inner.events.iter().map(|(key, value)| (key.to_string(), (*value).into())).collect()
}
/// Gets a map with the `UserId` of users with power levels other than `0`
/// and their power level.
pub fn user_power_levels(&self) -> HashMap<String, i64> {