mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-09-15 18:57:03 +00:00
feat: MSC4289, Explicitly privilege room creators (2/2)
(cherry picked from commit 4b833037ea
)
This commit is contained in:
parent
6b4cf0115d
commit
2209780999
3 changed files with 14 additions and 18 deletions
|
@ -1386,7 +1386,7 @@ impl Service {
|
|||
// events are then sorted by power level, time,
|
||||
// and lexically by event_id.
|
||||
Ok((
|
||||
int!(0),
|
||||
int!(0).into(),
|
||||
MilliSecondsSinceUnixEpoch(
|
||||
eventid_info
|
||||
.get(event_id)
|
||||
|
|
|
@ -488,15 +488,11 @@ impl Service {
|
|||
.authorization;
|
||||
|
||||
room_create
|
||||
// NOTE: This is because project hydra's client-side was made public before the server
|
||||
// side. This will be fixed by using `creators` instead in part 2/2.
|
||||
.creator(&rules)
|
||||
.creators(&rules)
|
||||
.map_err(|e| {
|
||||
error!("Failed to get creators of room id {}: {e}", room_id);
|
||||
Error::BadDatabase("RoomCreateEvent has invalid creators")
|
||||
})
|
||||
.map(|creator| {
|
||||
RoomPowerLevels::new(power_levels.into(), &rules, [creator.into_owned()])
|
||||
})
|
||||
.map(|creators| RoomPowerLevels::new(power_levels.into(), &rules, creators))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue