diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-08-19 12:30:28 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-08-19 12:30:28 +0100 |
commit | caef65d819cc420d61c6926be36c8d97bfb81886 (patch) | |
tree | 0b107db0af81a44122c2c73b8bd477a811509b9a /synapse | |
parent | Unquote sender IDs. (diff) | |
download | synapse-caef65d819cc420d61c6926be36c8d97bfb81886.tar.xz |
More unquotes. Also, don't return the room_id on membership state changes, they already know it.
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/rest/room.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/rest/room.py b/synapse/rest/room.py index c15eb9de48..db8f18e8b3 100644 --- a/synapse/rest/room.py +++ b/synapse/rest/room.py @@ -170,8 +170,10 @@ class RoomMemberRestServlet(RestServlet): user = yield self.auth.get_user_by_req(request) handler = self.handlers.room_member_handler - member = yield handler.get_room_member(room_id, target_user_id, - user.to_string()) + member = yield handler.get_room_member( + room_id, + urllib.unquote(target_user_id), + user.to_string()) if not member: raise SynapseError(404, "Member not found.", errcode=Codes.NOT_FOUND) @@ -183,7 +185,7 @@ class RoomMemberRestServlet(RestServlet): event = self.event_factory.create_event( etype=self.get_event_type(), - target_user_id=target_user_id, + target_user_id=urllib.unquote(target_user_id), room_id=urllib.unquote(roomid), user_id=user.to_string(), membership=Membership.LEAVE, @@ -210,7 +212,7 @@ class RoomMemberRestServlet(RestServlet): event = self.event_factory.create_event( etype=self.get_event_type(), - target_user_id=target_user_id, + target_user_id=urllib.unquote(target_user_id), room_id=urllib.unquote(roomid), user_id=user.to_string(), membership=content["membership"], @@ -218,8 +220,8 @@ class RoomMemberRestServlet(RestServlet): ) handler = self.handlers.room_member_handler - result = yield handler.change_membership(event, broadcast_msg=True) - defer.returnValue((200, result)) + yield handler.change_membership(event, broadcast_msg=True) + defer.returnValue((200, "")) class MessageRestServlet(RestServlet): |