mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Pass the session that updated the pointer from Django to Tornado
This allows us to check whether the session that updated the pointer is the same as a session that is doing a long poll to avoid sending new pointer information when that information is coming from the same session. We still return from the long poll early, though, which is sub-optimal. (imported from commit 7d4be0956f112eacefb7d198ea929957cd2b05e3)
This commit is contained in:
@@ -126,11 +126,12 @@ class UserProfile(models.Model):
|
||||
|
||||
callbacks_table.clear(self.user.id, Callbacks.TYPE_RECEIVE)
|
||||
|
||||
def update_pointer(self, new_pointer):
|
||||
def update_pointer(self, new_pointer, updater_session):
|
||||
global callbacks_table
|
||||
|
||||
for cb in callbacks_table.get(self.user.id, Callbacks.TYPE_POINTER_UPDATE):
|
||||
cb(new_pointer=new_pointer)
|
||||
cb(new_pointer=new_pointer, updater_session=updater_session,
|
||||
user_profile=self)
|
||||
|
||||
callbacks_table.clear(self.user.id, Callbacks.TYPE_POINTER_UPDATE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user