refactor: Rename locally_echoed to sent_by_this_client.

This is a bit clearer, since we will soon want to pass this option for
messages that could not be locally echoed due to markdown rendering.
This commit is contained in:
Mohit Gupta
2019-02-12 07:53:56 +05:30
committed by Tim Abbott
parent 944d590298
commit e5f28ca78e
2 changed files with 7 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ function maybe_add_narrowed_messages(messages, msg_list) {
}
exports.insert_new_messages = function insert_new_messages(messages, locally_echoed) {
exports.insert_new_messages = function insert_new_messages(messages, sent_by_this_client) {
messages = _.map(messages, message_store.add_message_metadata);
unread.process_loaded_messages(messages);
@@ -83,7 +83,7 @@ exports.insert_new_messages = function insert_new_messages(messages, locally_ech
}
if (locally_echoed) {
if (sent_by_this_client) {
var need_user_to_scroll = render_info && render_info.need_user_to_scroll;
notifications.notify_local_mixes(messages, need_user_to_scroll);
}

View File

@@ -588,12 +588,13 @@ exports.get_local_notify_mix_reason = function (message) {
exports.notify_local_mixes = function (messages, need_user_to_scroll) {
/*
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.
This code should only be called when we are displaying
messages sent by current client. It notifies users that
their messages aren't actually in the view that they
composed to.
This code is called after we insert messages into our
message list widgets. All of the conditions here are
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.