events: Implement From<RoomPowerLevels> for PushConditionPowerLevelsCtx
This commit is contained in:
parent
90d3605b87
commit
df1a63909a
@ -9,6 +9,7 @@ Improvements:
|
||||
- Don't fail event content parsing on invalid relation
|
||||
- We previously already accepted custom or slightly malformed relations
|
||||
- Now, even invalid / missing `rel_type` and `event_id` are accepted
|
||||
- Implement `From<RoomPowerLevels>` for `ruma_common::push::PushConditionPowerLevelsCtx`
|
||||
|
||||
# 0.27.11
|
||||
|
||||
|
@ -7,6 +7,7 @@ use std::{cmp::max, collections::BTreeMap};
|
||||
use js_int::{int, Int};
|
||||
use ruma_common::{
|
||||
power_levels::{default_power_level, NotificationPowerLevels},
|
||||
push::PushConditionPowerLevelsCtx,
|
||||
OwnedUserId, RoomVersionId, UserId,
|
||||
};
|
||||
use ruma_macros::EventContent;
|
||||
@ -500,6 +501,12 @@ impl From<RoomPowerLevels> for RoomPowerLevelsEventContent {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RoomPowerLevels> for PushConditionPowerLevelsCtx {
|
||||
fn from(c: RoomPowerLevels) -> Self {
|
||||
Self { users: c.users, users_default: c.users_default, notifications: c.notifications }
|
||||
}
|
||||
}
|
||||
|
||||
/// The actions that can be limited by power levels.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
|
Loading…
x
Reference in New Issue
Block a user