Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Make RoomMemberHandler functions private that can be #2980

Merged
merged 1 commit into from
Mar 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _local_membership_update(
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")

Expand Down Expand Up @@ -292,7 +292,7 @@ def _update_membership(
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)

Expand All @@ -306,15 +306,15 @@ def _update_membership(
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)

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")

Expand Down Expand Up @@ -496,7 +496,7 @@ def lookup_room_alias(self, room_alias):
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,
Expand Down Expand Up @@ -573,15 +573,15 @@ def _lookup_3pid(self, id_server, medium, address):
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:
logger.warn("Error from identity server lookup: %s" % (e,))
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():
Expand Down