mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 22:48:16 +00:00
local echo: Rename function to notify_local_mixes().
This commit renames possibly_notify_new_messages_outside_viewport() to the more concise name notify_local_mixes(). We really only need to call this function in one place, so we have the caller check the `local_id` condition. We can eventually upstream this code even further so that it's completely obvious that it's only ever called from the local-echo codepath.
This commit is contained in:
@@ -536,13 +536,18 @@ function get_message_header(message) {
|
||||
return "PM with " + message.display_reply_to;
|
||||
}
|
||||
|
||||
exports.possibly_notify_new_messages_outside_viewport = function (messages, local_id) {
|
||||
// A warning should only be displayed when the message was sent by the user and
|
||||
// this is the tab they sent it in.
|
||||
exports.notify_local_mixes = function (messages) {
|
||||
/*
|
||||
This code should only be called when we are locally echoing
|
||||
messages. It notifies users that their messages aren't
|
||||
actually in the view that they composed to.
|
||||
|
||||
if (local_id === undefined) {
|
||||
return;
|
||||
}
|
||||
This code is called after we insert messages into our
|
||||
message list widgets. All of the conditions here are
|
||||
checkable locally, so we may want to execute this code
|
||||
earlier in the codepath at some point and possibly punt
|
||||
on local rendering.
|
||||
*/
|
||||
|
||||
_.each(messages, function (message) {
|
||||
if (!people.is_my_user_id(message.sender_id)) {
|
||||
|
||||
Reference in New Issue
Block a user