refactor: Add function to state_accessor to get create event

This commit is contained in:
Ginger
2026-04-09 14:53:12 -04:00
parent 98ae827f5f
commit 6bde2d0fe4
5 changed files with 32 additions and 53 deletions
+7 -1
View File
@@ -147,7 +147,13 @@ pub(crate) async fn set_room_visibility_route(
return Err!(Request(Forbidden("Guests cannot publish to room directories")));
}
if !user_can_publish_room(&services, sender_user, &body.room_id).await? {
let room_power_levels = services
.rooms
.state_accessor
.get_room_power_levels(&body.room_id)
.await;
if !room_power_levels.user_can_send_state(user_id, StateEventType::RoomHistoryVisibility) {
return Err!(Request(Forbidden("User is not allowed to publish this room")));
}