0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-15 06:13:52 +01:00

Unquote sender IDs.

This commit is contained in:
Kegan Dougal 2014-08-19 11:50:57 +01:00
parent 88f7482b92
commit ece7a6d995

View file

@ -235,7 +235,7 @@ class MessageRestServlet(RestServlet):
msg_handler = self.handlers.message_handler msg_handler = self.handlers.message_handler
msg = yield msg_handler.get_message(room_id=urllib.unquote(room_id), 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, msg_id=msg_id,
user_id=user.to_string(), user_id=user.to_string(),
) )
@ -250,7 +250,7 @@ class MessageRestServlet(RestServlet):
def on_PUT(self, request, room_id, sender_id, msg_id): def on_PUT(self, request, room_id, sender_id, msg_id):
user = yield self.auth.get_user_by_req(request) 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.", raise SynapseError(403, "Must send messages as yourself.",
errcode=Codes.FORBIDDEN) errcode=Codes.FORBIDDEN)