summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-03 09:42:58 +0100
committerKegan Dougal <kegan@matrix.org>2014-09-03 09:43:32 +0100
commitc77add6d21663e875a4c74685845cfdfd6a1a6fe (patch)
tree4f6c59849f68089683379a3e6c7a6779e2c9117a /synapse/rest
parentAdd copyright notices and fix pyflakes errors (diff)
downloadsynapse-c77add6d21663e875a4c74685845cfdfd6a1a6fe.tar.xz
Add ban support: /rooms/$roomid/ban with { user_id : foo }
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/room.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/room.py b/synapse/rest/room.py
index a10b3b54f9..d76a2f5cd4 100644
--- a/synapse/rest/room.py
+++ b/synapse/rest/room.py
@@ -388,7 +388,7 @@ class RoomMembershipRestServlet(RestServlet):
     def register(self, http_server):
         # /rooms/$roomid/[invite|join|leave]
         PATTERN = ("/rooms/(?P<room_id>[^/]*)/" +
-            "(?P<membership_action>join|invite|leave)")
+            "(?P<membership_action>join|invite|leave|ban)")
         register_txn_path(self, PATTERN, http_server)
 
     @defer.inlineCallbacks
@@ -399,7 +399,7 @@ class RoomMembershipRestServlet(RestServlet):
 
         # target user is you unless it is an invite
         state_key = user.to_string()
-        if membership_action == "invite":
+        if membership_action in ["invite", "ban"]:
             if "user_id" not in content:
                 raise SynapseError(400, "Missing user_id key.")
             state_key = content["user_id"]