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

Add requester arg to send_membership_event, remove arg in remote_reject_invite #6009

Merged
merged 4 commits into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions changelog.d/6009.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Small refactor of function arguments and docstrings in RoomMemberHandler.
12 changes: 3 additions & 9 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ def _update_membership(
else:
# send the rejection to the inviter's HS.
remote_room_hosts = remote_room_hosts + [inviter.domain]
# Note: This is calling _remote_reject_invite on RoomMemberMasterHandler,
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
# hence the `requester` arg
res = yield self._remote_reject_invite(
requester, remote_room_hosts, room_id, target
)
Expand All @@ -510,9 +512,7 @@ def _update_membership(
return res

@defer.inlineCallbacks
def send_membership_event(
self, requester, event, context, remote_room_hosts=None, ratelimit=True
):
def send_membership_event(self, requester, event, context, ratelimit=True):
"""
Change the membership status of a user in a room.

Expand All @@ -522,16 +522,10 @@ def send_membership_event(
act as the sender, will be skipped.
event (SynapseEvent): The membership event.
context: The context of the event.
is_guest (bool): Whether the sender is a guest.
room_hosts ([str]): Homeservers which are likely to already be in
the room, and could be danced with in order to join this
homeserver for the first time.
ratelimit (bool): Whether to rate limit this request.
Raises:
SynapseError if there was a problem changing the membership.
"""
remote_room_hosts = remote_room_hosts or []

target_user = UserID.from_string(event.state_key)
room_id = event.room_id

Expand Down