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

Commit

Permalink
Remove get_joined_rooms_for_user from RoomMemberHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Haines committed May 16, 2016
1 parent 816df9f commit 80cb9be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,7 @@ def do_3pid_invite(
)

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,
Expand Down
6 changes: 3 additions & 3 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,17 +485,17 @@ def incremental_sync_with_gap(self, sync_config, since_token):
sync_config, now_token, since_token
)

rm_handler = self.hs.get_handlers().room_member_handler
app_service = yield self.store.get_app_service_by_user_id(
sync_config.user.to_string()
)
if app_service:
rooms = yield self.store.get_app_service_rooms(app_service)
joined_room_ids = set(r.room_id for r in rooms)
else:
joined_room_ids = yield rm_handler.get_joined_rooms_for_user(
sync_config.user
rooms = yield self.store.get_rooms_for_user(
sync_config.user.to_string()
)
joined_room_ids = set(r.room_id for r in rooms)

user_id = sync_config.user.to_string()

Expand Down
6 changes: 0 additions & 6 deletions synapse/handlers/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,13 @@ def __init__(self, hs):
self.hs = hs
self.clock = hs.get_clock()
self._handler = None
self._room_member_handler = None

def handler(self):
# Avoid cyclic dependency in handler setup
if not self._handler:
self._handler = self.hs.get_handlers().typing_notification_handler
return self._handler

def room_member_handler(self):
if not self._room_member_handler:
self._room_member_handler = self.hs.get_handlers().room_member_handler
return self._room_member_handler

def _make_event_for(self, room_id):
typing = self.handler()._room_typing[room_id]
return {
Expand Down

0 comments on commit 80cb9be

Please sign in to comment.