mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Add ban support: /rooms/$roomid/ban with { user_id : foo }
This commit is contained in:
parent
c6eafdfbaf
commit
c77add6d21
@ -388,7 +388,7 @@ class RoomMembershipRestServlet(RestServlet):
|
|||||||
def register(self, http_server):
|
def register(self, http_server):
|
||||||
# /rooms/$roomid/[invite|join|leave]
|
# /rooms/$roomid/[invite|join|leave]
|
||||||
PATTERN = ("/rooms/(?P<room_id>[^/]*)/" +
|
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)
|
register_txn_path(self, PATTERN, http_server)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
@ -399,7 +399,7 @@ class RoomMembershipRestServlet(RestServlet):
|
|||||||
|
|
||||||
# target user is you unless it is an invite
|
# target user is you unless it is an invite
|
||||||
state_key = user.to_string()
|
state_key = user.to_string()
|
||||||
if membership_action == "invite":
|
if membership_action in ["invite", "ban"]:
|
||||||
if "user_id" not in content:
|
if "user_id" not in content:
|
||||||
raise SynapseError(400, "Missing user_id key.")
|
raise SynapseError(400, "Missing user_id key.")
|
||||||
state_key = content["user_id"]
|
state_key = content["user_id"]
|
||||||
|
Loading…
Reference in New Issue
Block a user