Remove get_joined_rooms_for_user from RoomMemberHandler

This commit is contained in:
Mark Haines 2016-05-16 20:06:55 +01:00
parent 816df9f267
commit 80cb9becd8
3 changed files with 4 additions and 11 deletions

View File

@ -428,8 +428,7 @@ class RoomMemberHandler(BaseHandler):
) )
if invitee: if invitee:
handler = self.hs.get_handlers().room_member_handler yield self.update_membership(
yield handler.update_membership(
requester, requester,
UserID.from_string(invitee), UserID.from_string(invitee),
room_id, room_id,

View File

@ -485,7 +485,6 @@ class SyncHandler(BaseHandler):
sync_config, now_token, 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( app_service = yield self.store.get_app_service_by_user_id(
sync_config.user.to_string() sync_config.user.to_string()
) )
@ -493,9 +492,10 @@ class SyncHandler(BaseHandler):
rooms = yield self.store.get_app_service_rooms(app_service) rooms = yield self.store.get_app_service_rooms(app_service)
joined_room_ids = set(r.room_id for r in rooms) joined_room_ids = set(r.room_id for r in rooms)
else: else:
joined_room_ids = yield rm_handler.get_joined_rooms_for_user( rooms = yield self.store.get_rooms_for_user(
sync_config.user sync_config.user.to_string()
) )
joined_room_ids = set(r.room_id for r in rooms)
user_id = sync_config.user.to_string() user_id = sync_config.user.to_string()

View File

@ -229,7 +229,6 @@ class TypingNotificationEventSource(object):
self.hs = hs self.hs = hs
self.clock = hs.get_clock() self.clock = hs.get_clock()
self._handler = None self._handler = None
self._room_member_handler = None
def handler(self): def handler(self):
# Avoid cyclic dependency in handler setup # Avoid cyclic dependency in handler setup
@ -237,11 +236,6 @@ class TypingNotificationEventSource(object):
self._handler = self.hs.get_handlers().typing_notification_handler self._handler = self.hs.get_handlers().typing_notification_handler
return self._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): def _make_event_for(self, room_id):
typing = self.handler()._room_typing[room_id] typing = self.handler()._room_typing[room_id]
return { return {