mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 10:54:53 -04:00
Don't recreate so many sets
This commit is contained in:
parent
2ccf3b241c
commit
6957bfdca6
10 changed files with 42 additions and 51 deletions
|
@ -304,8 +304,7 @@ class Notifier(object):
|
|||
if user_stream is None:
|
||||
current_token = yield self.event_sources.get_current_token()
|
||||
if room_ids is None:
|
||||
rooms = yield self.store.get_rooms_for_user(user_id)
|
||||
room_ids = [room.room_id for room in rooms]
|
||||
room_ids = yield self.store.get_rooms_for_user(user_id)
|
||||
user_stream = _NotifierUserStream(
|
||||
user_id=user_id,
|
||||
rooms=room_ids,
|
||||
|
@ -454,8 +453,7 @@ class Notifier(object):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def _get_room_ids(self, user, explicit_room_id):
|
||||
joined_rooms = yield self.store.get_rooms_for_user(user.to_string())
|
||||
joined_room_ids = map(lambda r: r.room_id, joined_rooms)
|
||||
joined_room_ids = yield self.store.get_rooms_for_user(user.to_string())
|
||||
if explicit_room_id:
|
||||
if explicit_room_id in joined_room_ids:
|
||||
defer.returnValue(([explicit_room_id], True))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue