mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-22 01:25:44 +03:00
More unquotes. Also, don't return the room_id on membership state changes, they already know it.
This commit is contained in:
parent
ece7a6d995
commit
caef65d819
1 changed files with 8 additions and 6 deletions
|
@ -170,8 +170,10 @@ class RoomMemberRestServlet(RestServlet):
|
||||||
user = yield self.auth.get_user_by_req(request)
|
user = yield self.auth.get_user_by_req(request)
|
||||||
|
|
||||||
handler = self.handlers.room_member_handler
|
handler = self.handlers.room_member_handler
|
||||||
member = yield handler.get_room_member(room_id, target_user_id,
|
member = yield handler.get_room_member(
|
||||||
user.to_string())
|
room_id,
|
||||||
|
urllib.unquote(target_user_id),
|
||||||
|
user.to_string())
|
||||||
if not member:
|
if not member:
|
||||||
raise SynapseError(404, "Member not found.",
|
raise SynapseError(404, "Member not found.",
|
||||||
errcode=Codes.NOT_FOUND)
|
errcode=Codes.NOT_FOUND)
|
||||||
|
@ -183,7 +185,7 @@ class RoomMemberRestServlet(RestServlet):
|
||||||
|
|
||||||
event = self.event_factory.create_event(
|
event = self.event_factory.create_event(
|
||||||
etype=self.get_event_type(),
|
etype=self.get_event_type(),
|
||||||
target_user_id=target_user_id,
|
target_user_id=urllib.unquote(target_user_id),
|
||||||
room_id=urllib.unquote(roomid),
|
room_id=urllib.unquote(roomid),
|
||||||
user_id=user.to_string(),
|
user_id=user.to_string(),
|
||||||
membership=Membership.LEAVE,
|
membership=Membership.LEAVE,
|
||||||
|
@ -210,7 +212,7 @@ class RoomMemberRestServlet(RestServlet):
|
||||||
|
|
||||||
event = self.event_factory.create_event(
|
event = self.event_factory.create_event(
|
||||||
etype=self.get_event_type(),
|
etype=self.get_event_type(),
|
||||||
target_user_id=target_user_id,
|
target_user_id=urllib.unquote(target_user_id),
|
||||||
room_id=urllib.unquote(roomid),
|
room_id=urllib.unquote(roomid),
|
||||||
user_id=user.to_string(),
|
user_id=user.to_string(),
|
||||||
membership=content["membership"],
|
membership=content["membership"],
|
||||||
|
@ -218,8 +220,8 @@ class RoomMemberRestServlet(RestServlet):
|
||||||
)
|
)
|
||||||
|
|
||||||
handler = self.handlers.room_member_handler
|
handler = self.handlers.room_member_handler
|
||||||
result = yield handler.change_membership(event, broadcast_msg=True)
|
yield handler.change_membership(event, broadcast_msg=True)
|
||||||
defer.returnValue((200, result))
|
defer.returnValue((200, ""))
|
||||||
|
|
||||||
|
|
||||||
class MessageRestServlet(RestServlet):
|
class MessageRestServlet(RestServlet):
|
||||||
|
|
Loading…
Reference in a new issue