mirror of https://github.com/zulip/zulip.git
Only add a pointer update callback if the client is interested in pointer updates
Previously, if the client was not interested in pointer updates, they would still return early from get_updates() when the pointer was updated. (imported from commit ef9d8b5678b7e72f799840148577651ee10d47ad)
This commit is contained in:
parent
99cf78e1aa
commit
3cc353fc7e
|
@ -331,12 +331,9 @@ def format_delayed_updates_response(request=None, user_profile=None,
|
||||||
new_pointer=None, pointer_updater=None,
|
new_pointer=None, pointer_updater=None,
|
||||||
client_id=None, update_types=[],
|
client_id=None, update_types=[],
|
||||||
**kwargs):
|
**kwargs):
|
||||||
client_pointer = request.POST.get("pointer")
|
|
||||||
if client_pointer is not None:
|
|
||||||
pointer = new_pointer
|
|
||||||
update_types.append("pointer_update")
|
update_types.append("pointer_update")
|
||||||
|
|
||||||
return format_updates_response(new_pointer=pointer,
|
return format_updates_response(new_pointer=new_pointer,
|
||||||
user_profile=user_profile,
|
user_profile=user_profile,
|
||||||
update_types=update_types, **kwargs)
|
update_types=update_types, **kwargs)
|
||||||
|
|
||||||
|
@ -460,6 +457,7 @@ def get_updates_backend(request, user_profile, handler, client_id,
|
||||||
pass
|
pass
|
||||||
|
|
||||||
user_profile.add_receive_callback(handler.async_callback(cb))
|
user_profile.add_receive_callback(handler.async_callback(cb))
|
||||||
|
if client_pointer is not None:
|
||||||
user_profile.add_pointer_update_callback(handler.async_callback(cb))
|
user_profile.add_pointer_update_callback(handler.async_callback(cb))
|
||||||
|
|
||||||
# runtornado recognizes this special return value.
|
# runtornado recognizes this special return value.
|
||||||
|
|
Loading…
Reference in New Issue