|
|
|
@ -138,7 +138,7 @@ class RoomMemberHandler(object): |
|
|
|
|
defer.returnValue(event) |
|
|
|
|
|
|
|
|
|
@defer.inlineCallbacks |
|
|
|
|
def remote_join(self, remote_room_hosts, room_id, user, content): |
|
|
|
|
def _remote_join(self, remote_room_hosts, room_id, user, content): |
|
|
|
|
if len(remote_room_hosts) == 0: |
|
|
|
|
raise SynapseError(404, "No known servers") |
|
|
|
|
|
|
|
|
@ -292,7 +292,7 @@ class RoomMemberHandler(object): |
|
|
|
|
raise AuthError(403, "Guest access not allowed") |
|
|
|
|
|
|
|
|
|
if not is_host_in_room: |
|
|
|
|
inviter = yield self.get_inviter(target.to_string(), room_id) |
|
|
|
|
inviter = yield self._get_inviter(target.to_string(), room_id) |
|
|
|
|
if inviter and not self.hs.is_mine(inviter): |
|
|
|
|
remote_room_hosts.append(inviter.domain) |
|
|
|
|
|
|
|
|
@ -306,7 +306,7 @@ class RoomMemberHandler(object): |
|
|
|
|
if requester.is_guest: |
|
|
|
|
content["kind"] = "guest" |
|
|
|
|
|
|
|
|
|
ret = yield self.remote_join( |
|
|
|
|
ret = yield self._remote_join( |
|
|
|
|
remote_room_hosts, room_id, target, content |
|
|
|
|
) |
|
|
|
|
defer.returnValue(ret) |
|
|
|
@ -314,7 +314,7 @@ class RoomMemberHandler(object): |
|
|
|
|
elif effective_membership_state == Membership.LEAVE: |
|
|
|
|
if not is_host_in_room: |
|
|
|
|
# perhaps we've been invited |
|
|
|
|
inviter = yield self.get_inviter(target.to_string(), room_id) |
|
|
|
|
inviter = yield self._get_inviter(target.to_string(), room_id) |
|
|
|
|
if not inviter: |
|
|
|
|
raise SynapseError(404, "Not a known room") |
|
|
|
|
|
|
|
|
@ -496,7 +496,7 @@ class RoomMemberHandler(object): |
|
|
|
|
defer.returnValue((RoomID.from_string(room_id), servers)) |
|
|
|
|
|
|
|
|
|
@defer.inlineCallbacks |
|
|
|
|
def get_inviter(self, user_id, room_id): |
|
|
|
|
def _get_inviter(self, user_id, room_id): |
|
|
|
|
invite = yield self.store.get_invite_for_user_in_room( |
|
|
|
|
user_id=user_id, |
|
|
|
|
room_id=room_id, |
|
|
|
@ -573,7 +573,7 @@ class RoomMemberHandler(object): |
|
|
|
|
if "mxid" in data: |
|
|
|
|
if "signatures" not in data: |
|
|
|
|
raise AuthError(401, "No signatures on 3pid binding") |
|
|
|
|
yield self.verify_any_signature(data, id_server) |
|
|
|
|
yield self._verify_any_signature(data, id_server) |
|
|
|
|
defer.returnValue(data["mxid"]) |
|
|
|
|
|
|
|
|
|
except IOError as e: |
|
|
|
@ -581,7 +581,7 @@ class RoomMemberHandler(object): |
|
|
|
|
defer.returnValue(None) |
|
|
|
|
|
|
|
|
|
@defer.inlineCallbacks |
|
|
|
|
def verify_any_signature(self, data, server_hostname): |
|
|
|
|
def _verify_any_signature(self, data, server_hostname): |
|
|
|
|
if server_hostname not in data["signatures"]: |
|
|
|
|
raise AuthError(401, "No signature from server %s" % (server_hostname,)) |
|
|
|
|
for key_name, signature in data["signatures"][server_hostname].items(): |
|
|
|
|