diff options
author | Erik Johnston <erik@matrix.org> | 2014-08-19 14:48:19 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-08-19 14:48:19 +0100 |
commit | 347242a5c408d4ceb1880f6b90c8e9c658226dde (patch) | |
tree | 12a25b72d8f13a48f99441c249c3c531c79fff66 /synapse/rest | |
parent | Fix bug where we sometimes set min_token to None. (diff) | |
parent | Proofing (diff) | |
download | synapse-347242a5c408d4ceb1880f6b90c8e9c658226dde.tar.xz |
Merge branch 'master' of github.com:matrix-org/synapse into sql_refactor
Conflicts: tests/rest/test_presence.py tests/rest/test_rooms.py tests/utils.py
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/room.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/synapse/rest/room.py b/synapse/rest/room.py index 89ea9f0d25..1c48e63628 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): @@ -235,7 +237,7 @@ class MessageRestServlet(RestServlet): msg_handler = self.handlers.message_handler msg = yield msg_handler.get_message(room_id=urllib.unquote(room_id), - sender_id=sender_id, + sender_id=urllib.unquote(sender_id), msg_id=msg_id, user_id=user.to_string(), ) @@ -250,7 +252,7 @@ class MessageRestServlet(RestServlet): def on_PUT(self, request, room_id, sender_id, msg_id): user = yield self.auth.get_user_by_req(request) - if user.to_string() != sender_id: + if user.to_string() != urllib.unquote(sender_id): raise SynapseError(403, "Must send messages as yourself.", errcode=Codes.FORBIDDEN) |