zulip/zerver/tornado
Steve Howell aae0b2a826 Notify offline users about edited stream messages.
We now do push notifications and missed message emails
for offline users who are subscribed to the stream for
a message that has been edited, but we short circuit
the offline-notification logic for any user who presumably
would have already received a notification on the original
message.

This effectively boils down to sending notifications to newly
mentioned users.  The motivating use case here is that you
forget to mention somebody in a message, and then you edit
the message to mention the person.  If they are offline, they
will now get pushed notifications and missed message emails,
with some minor caveats.

We try to mostly use the same techniques here as the
send-message code path, and we share common code with the
send-message path once we get to the Tornado layer and call
maybe_enqueue_notifications.

The major places where we differ are in a function called
maybe_enqueue_notifications_for_message_update, and the top
of that function short circuits a bunch of cases where we
can mostly assume that the original message had an offline
notification.

We can expect a couple changes in the future:

    * Requirements may change here, and it might make sense
      to send offline notifications on the update side even
      in circumstances where the original message had a
      notification.

    * We may track more notifications in a DB model, which
      may simplify our short-circuit logic.

In the view/action layer, we already had two separate codepaths
for send-message and update-message, but this mostly echoes
what the send-message path does in terms of collecting data
about recipients.
2017-10-03 15:57:06 -07:00
..
__init__.py tornado: Move tornado_ioloop_logging to new zerver/tornado tree. 2016-11-26 21:24:05 -08:00
application.py zerver/tornado: Remove print_function. 2017-09-27 18:05:45 -07:00
descriptors.py zerver/tornado: Remove print_function. 2017-09-27 18:05:45 -07:00
event_queue.py Notify offline users about edited stream messages. 2017-10-03 15:57:06 -07:00
exceptions.py zerver/tornado: Remove absolute_import. 2017-09-27 10:00:39 -07:00
handlers.py zerver/tornado: remove `import six`. 2017-09-27 19:10:28 -07:00
ioloop_logging.py zerver/tornado: Remove from __future__ import *. 2017-09-28 10:14:03 -07:00
socket.py zerver/tornado: Remove absolute_import. 2017-09-27 10:00:39 -07:00
views.py zerver/tornado: Remove absolute_import. 2017-09-27 10:00:39 -07:00
websocket_client.py websocket_client: Use get_system_bot. 2017-08-24 23:16:18 -07:00