mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Some cleanup
I'm not particularly happy with the "action" switching, but there's no convenient way to defer the work that needs to happen after it, so... :(
This commit is contained in:
parent
a4e278bfe7
commit
591af2d074
2 changed files with 59 additions and 67 deletions
|
@ -230,11 +230,11 @@ class JoinRoomAliasServlet(ClientV1RestServlet):
|
|||
|
||||
if RoomID.is_valid(room_identifier):
|
||||
room_id = room_identifier
|
||||
room_hosts = None
|
||||
remote_room_hosts = None
|
||||
elif RoomAlias.is_valid(room_identifier):
|
||||
handler = self.handlers.room_member_handler
|
||||
room_alias = RoomAlias.from_string(room_identifier)
|
||||
room_id, room_hosts = yield handler.lookup_room_alias(room_alias)
|
||||
room_id, remote_room_hosts = yield handler.lookup_room_alias(room_alias)
|
||||
room_id = room_id.to_string()
|
||||
else:
|
||||
raise SynapseError(400, "%s was not legal room ID or room alias" % (
|
||||
|
@ -247,7 +247,7 @@ class JoinRoomAliasServlet(ClientV1RestServlet):
|
|||
room_id=room_id,
|
||||
action="join",
|
||||
txn_id=txn_id,
|
||||
room_hosts=room_hosts,
|
||||
remote_room_hosts=remote_room_hosts,
|
||||
)
|
||||
|
||||
defer.returnValue((200, {"room_id": room_id}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue