diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-05-17 10:43:19 +0100 |
---|---|---|
committer | Mark Haines <mjark@negativecurvature.net> | 2016-05-17 10:43:19 +0100 |
commit | 1ed33784a6a7a7fb59ba96edf78df3367cff5a44 (patch) | |
tree | 71b6969dc6785e03e20eaca7d771bde7ece1eab2 /synapse/handlers/room_member.py | |
parent | Merge pull request #787 from matrix-org/markjh/liberate_presence_handler (diff) | |
parent | Remove unused get_joined_rooms_for_user (diff) | |
download | synapse-1ed33784a6a7a7fb59ba96edf78df3367cff5a44.tar.xz |
Merge pull request #789 from matrix-org/markjh/member_cleanup
Cleanup room member handler
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r-- | synapse/handlers/room_member.py | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index b44e52a515..7e616f44fd 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -56,35 +56,6 @@ class RoomMemberHandler(BaseHandler): self.distributor.declare("user_left_room") @defer.inlineCallbacks - def get_room_members(self, room_id): - users = yield self.store.get_users_in_room(room_id) - - defer.returnValue([UserID.from_string(u) for u in users]) - - @defer.inlineCallbacks - def fetch_room_distributions_into(self, room_id, localusers=None, - remotedomains=None, ignore_user=None): - """Fetch the distribution of a room, adding elements to either - 'localusers' or 'remotedomains', which should be a set() if supplied. - If ignore_user is set, ignore that user. - - This function returns nothing; its result is performed by the - side-effect on the two passed sets. This allows easy accumulation of - member lists of multiple rooms at once if required. - """ - members = yield self.get_room_members(room_id) - for member in members: - if ignore_user is not None and member == ignore_user: - continue - - if self.hs.is_mine(member): - if localusers is not None: - localusers.add(member) - else: - if remotedomains is not None: - remotedomains.add(member.domain) - - @defer.inlineCallbacks def _local_membership_update( self, requester, target, room_id, membership, prev_event_ids, @@ -427,21 +398,6 @@ class RoomMemberHandler(BaseHandler): defer.returnValue(UserID.from_string(invite.sender)) @defer.inlineCallbacks - def get_joined_rooms_for_user(self, user): - """Returns a list of roomids that the user has any of the given - membership states in.""" - - rooms = yield self.store.get_rooms_for_user( - user.to_string(), - ) - - # For some reason the list of events contains duplicates - # TODO(paul): work out why because I really don't think it should - room_ids = set(r.room_id for r in rooms) - - defer.returnValue(room_ids) - - @defer.inlineCallbacks def do_3pid_invite( self, room_id, @@ -457,8 +413,7 @@ class RoomMemberHandler(BaseHandler): ) if invitee: - handler = self.hs.get_handlers().room_member_handler - yield handler.update_membership( + yield self.update_membership( requester, UserID.from_string(invitee), room_id, |