mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Update power level default for public rooms (#16907)
This commit is contained in:
parent
8fb5b0f335
commit
cf5adc80e1
1
changelog.d/16907.misc
Normal file
1
changelog.d/16907.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Update power level default for public rooms (#16907).
|
@ -151,7 +151,7 @@ class RoomCreationHandler:
|
|||||||
"history_visibility": HistoryVisibility.SHARED,
|
"history_visibility": HistoryVisibility.SHARED,
|
||||||
"original_invitees_have_ops": False,
|
"original_invitees_have_ops": False,
|
||||||
"guest_can_join": False,
|
"guest_can_join": False,
|
||||||
"power_level_content_override": {},
|
"power_level_content_override": {EventTypes.CallInvite: 50},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ class RoomPermissionsTestCase(RoomBase):
|
|||||||
rmcreator_id = "@notme:red"
|
rmcreator_id = "@notme:red"
|
||||||
|
|
||||||
def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
|
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
|
self.helper.auth_user_id = self.rmcreator_id
|
||||||
# create some rooms under the name rmcreator_id
|
# create some rooms under the name rmcreator_id
|
||||||
self.uncreated_rmid = "!aa:test"
|
self.uncreated_rmid = "!aa:test"
|
||||||
@ -482,6 +483,23 @@ class RoomPermissionsTestCase(RoomBase):
|
|||||||
expect_code=HTTPStatus.OK,
|
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):
|
class RoomStateTestCase(RoomBase):
|
||||||
"""Tests /rooms/$room_id/state."""
|
"""Tests /rooms/$room_id/state."""
|
||||||
|
Loading…
Reference in New Issue
Block a user