mirror of https://github.com/zulip/zulip.git
Clean up the update_pointer tornado notification code path.
(imported from commit 94997dea54e6cc8e5b5a314a95d6114773462608)
This commit is contained in:
parent
0507b1bb06
commit
167b883c38
|
@ -1497,11 +1497,8 @@ def do_update_pointer(user_profile, pointer, update_flags=False):
|
|||
flags=~UserMessage.flags.read) \
|
||||
.update(flags=F('flags').bitor(UserMessage.flags.read))
|
||||
|
||||
if settings.TORNADO_SERVER:
|
||||
tornado_callbacks.send_notification(dict(
|
||||
type = 'pointer_update',
|
||||
user = user_profile.id,
|
||||
new_pointer = pointer))
|
||||
event = dict(type='pointer', pointer=pointer)
|
||||
send_event(event, [user_profile.id])
|
||||
|
||||
def do_update_message_flags(user_profile, operation, flag, messages, all):
|
||||
flagattr = getattr(UserMessage.flags, flag)
|
||||
|
|
|
@ -25,12 +25,6 @@ import datetime
|
|||
# after they are idle for 1 hour
|
||||
NOTIFY_AFTER_IDLE_HOURS = 1
|
||||
|
||||
def update_pointer(user_profile_id, new_pointer):
|
||||
event = dict(type='pointer', pointer=new_pointer)
|
||||
for client in get_client_descriptors_for_user(user_profile_id):
|
||||
if client.accepts_event(event):
|
||||
client.add_event(event.copy())
|
||||
|
||||
def build_offline_notification_event(user_profile_id, message_id):
|
||||
return {"user_profile_id": user_profile_id,
|
||||
"message_id": message_id,
|
||||
|
@ -222,8 +216,6 @@ def process_notification(data):
|
|||
process_new_message(data)
|
||||
elif data['type'] == 'update_message':
|
||||
process_update_message(data)
|
||||
elif data['type'] == 'pointer_update':
|
||||
update_pointer(data['user'], data['new_pointer'])
|
||||
else:
|
||||
raise JsonableError('bad notification type ' + data['type'])
|
||||
|
||||
|
|
Loading…
Reference in New Issue