Compare commits

...

2 Commits

Author SHA1 Message Date
Andrew Morgan
b46d69b033 Derive users to notify from user streams in on_new_event
Otherwise we were completely ignoring all users discovered from rooms being passed
to this function.
2022-02-03 14:51:18 +00:00
Andrew Morgan
22a9ad2780 Re-use calculated list of users instead of re-calculating in on_new_event 2022-02-03 14:32:41 +00:00
2 changed files with 4 additions and 6 deletions

View File

@@ -495,13 +495,11 @@ class DeviceHandler(DeviceWorkerHandler):
"Notifying about update %r/%r, ID: %r", user_id, device_id, position
)
room_ids = await self.store.get_rooms_for_user(user_id)
# specify the user ID too since the user should always get their own device list
# updates, even if they aren't in any rooms.
self.notifier.on_new_event(
"device_list_key", position, users=[user_id], rooms=room_ids
)
users_to_notify = users_who_share_room.union(user_id)
self.notifier.on_new_event("device_list_key", position, users=users_to_notify)
if hosts:
logger.info(

View File

@@ -458,7 +458,7 @@ class Notifier:
self.appservice_handler.notify_interested_services_ephemeral(
stream_key,
new_token,
users,
[UserID.from_string(user_stream.user_id) for user_stream in user_streams],
)
except Exception:
logger.exception(