summary refs log tree commit diff
path: root/synapse/rest/admin/rooms.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-08-20 15:07:42 -0400
committerGitHub <noreply@github.com>2020-08-20 15:07:42 -0400
commite259d63f73fd7599520d0c4a6f5082e5cd383d25 (patch)
tree1d81842222fc60c9ed4258151362d1c872c1bab9 /synapse/rest/admin/rooms.py
parentBe more tolerant of membership events in unknown rooms (#8110) (diff)
downloadsynapse-e259d63f73fd7599520d0c4a6f5082e5cd383d25.tar.xz
Stop shadow-banned users from sending invites. (#8095)
Diffstat (limited to 'synapse/rest/admin/rooms.py')
-rw-r--r--synapse/rest/admin/rooms.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py
index 7c292ef3f9..09726d52d6 100644
--- a/synapse/rest/admin/rooms.py
+++ b/synapse/rest/admin/rooms.py
@@ -316,6 +316,9 @@ class JoinRoomAliasServlet(RestServlet):
         join_rules_event = room_state.get((EventTypes.JoinRules, ""))
         if join_rules_event:
             if not (join_rules_event.content.get("join_rule") == JoinRules.PUBLIC):
+                # update_membership with an action of "invite" can raise a
+                # ShadowBanError. This is not handled since it is assumed that
+                # an admin isn't going to call this API with a shadow-banned user.
                 await self.room_member_handler.update_membership(
                     requester=requester,
                     target=fake_requester.user,