mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-08 16:04:13 -04:00
refactor(ffi): expose privileged_creators_role in the FFI RoomInfo
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
7a5f83f6ec
commit
1be8b42d03
@@ -8,8 +8,9 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Features:
|
||||
|
||||
- Add `room_version` and `privileged_creators_role` to `RoomInfo` ([#5449](https://github.com/matrix-org/matrix-rust-sdk/pull/5449)).
|
||||
- The [`unstable-hydra`] feature has been enabled, which enables room v12 changes in the SDK.
|
||||
[(#5450)](https://github.com/matrix-org/matrix-rust-sdk/pull/5450).
|
||||
([#5450](https://github.com/matrix-org/matrix-rust-sdk/pull/5450)).
|
||||
- Add experimental support for
|
||||
[MSC4306](https://github.com/matrix-org/matrix-spec-proposals/pull/4306), with the
|
||||
`Room::fetch_thread_subscription()` and `Room::set_thread_subscription()` methods.
|
||||
|
||||
@@ -76,6 +76,9 @@ pub struct RoomInfo {
|
||||
power_levels: Option<Arc<RoomPowerLevels>>,
|
||||
/// This room's version.
|
||||
room_version: Option<String>,
|
||||
/// Whether creators are privileged over every other user (have infinite
|
||||
/// power level).
|
||||
privileged_creators_role: bool,
|
||||
}
|
||||
|
||||
impl RoomInfo {
|
||||
@@ -155,6 +158,11 @@ impl RoomInfo {
|
||||
history_visibility: room.history_visibility_or_default().try_into()?,
|
||||
power_levels: power_levels.map(Arc::new),
|
||||
room_version: room.version().map(|version| version.to_string()),
|
||||
privileged_creators_role: room
|
||||
.version()
|
||||
.and_then(|version| version.rules())
|
||||
.map(|rules| rules.authorization.explicitly_privilege_room_creators)
|
||||
.unwrap_or_default(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user