mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
Index the presence data sent from Django to Tornado by ID.
(imported from commit 8ffb70562b49ba93c5b0927b34dc57a743d49564)
This commit is contained in:
@@ -356,7 +356,7 @@ def do_send_messages(messages):
|
||||
presences = {}
|
||||
for user_profile in message['active_recipients']:
|
||||
if user_profile.email in user_presences:
|
||||
presences[user_profile.email] = user_presences[user_profile.email]
|
||||
presences[user_profile.id] = user_presences[user_profile.email]
|
||||
|
||||
data = dict(
|
||||
type = 'new_message',
|
||||
|
||||
@@ -109,12 +109,12 @@ def receiver_is_idle(user_profile, realm_presences):
|
||||
# presence information in this case (and it's hard to get without an additional
|
||||
# db query) so we simply don't try to guess if this cross-realm recipient
|
||||
# has been idle for too long
|
||||
if realm_presences is None or not user_profile.email in realm_presences:
|
||||
if realm_presences is None or not user_profile.id in realm_presences:
|
||||
return off_zulip
|
||||
|
||||
# If the most recent online status from a user is >1hr in the past, we notify
|
||||
# them regardless of whether or not they have an open window
|
||||
user_presence = realm_presences[user_profile.email]
|
||||
user_presence = realm_presences[user_profile.id]
|
||||
idle_too_long = False
|
||||
newest = None
|
||||
for client, status in user_presence.iteritems():
|
||||
|
||||
Reference in New Issue
Block a user