Don't recreate so many sets

This commit is contained in:
Erik Johnston 2017-03-16 11:51:46 +00:00
parent 2ccf3b241c
commit 6957bfdca6
10 changed files with 42 additions and 51 deletions

View file

@ -33,13 +33,13 @@ def get_badge_count(store, user_id):
badge = len(invites)
for r in joins:
if r.room_id in my_receipts_by_room:
last_unread_event_id = my_receipts_by_room[r.room_id]
for room_id in joins:
if room_id in my_receipts_by_room:
last_unread_event_id = my_receipts_by_room[room_id]
notifs = yield (
store.get_unread_event_push_actions_by_room_for_user(
r.room_id, user_id, last_unread_event_id
room_id, user_id, last_unread_event_id
)
)
# return one badge count per conversation, as count per