Update power level default for public rooms (#16907)

This commit is contained in:
Shay 2024-03-19 10:55:31 -07:00 committed by GitHub
parent 8fb5b0f335
commit cf5adc80e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 1 deletions

1
changelog.d/16907.misc Normal file
View File

@ -0,0 +1 @@
Update power level default for public rooms (#16907).

View File

@ -151,7 +151,7 @@ class RoomCreationHandler:
"history_visibility": HistoryVisibility.SHARED,
"original_invitees_have_ops": False,
"guest_can_join": False,
"power_level_content_override": {},
"power_level_content_override": {EventTypes.CallInvite: 50},
},
}

View File

@ -93,6 +93,7 @@ class RoomPermissionsTestCase(RoomBase):
rmcreator_id = "@notme:red"
def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
self.store_controllers = hs.get_storage_controllers()
self.helper.auth_user_id = self.rmcreator_id
# create some rooms under the name rmcreator_id
self.uncreated_rmid = "!aa:test"
@ -482,6 +483,23 @@ class RoomPermissionsTestCase(RoomBase):
expect_code=HTTPStatus.OK,
)
def test_default_call_invite_power_level(self) -> None:
pl_event = self.get_success(
self.store_controllers.state.get_current_state_event(
self.created_public_rmid, EventTypes.PowerLevels, ""
)
)
assert pl_event is not None
self.assertEqual(50, pl_event.content.get("m.call.invite"))
private_pl_event = self.get_success(
self.store_controllers.state.get_current_state_event(
self.created_rmid, EventTypes.PowerLevels, ""
)
)
assert private_pl_event is not None
self.assertEqual(None, private_pl_event.content.get("m.call.invite"))
class RoomStateTestCase(RoomBase):
"""Tests /rooms/$room_id/state."""