Extract maybe_advance_to_recently_sent_message.

All the rest of the code in its caller was high-level dispatch
stuff, so it just looked fine of funny.
This commit is contained in:
Steve Howell
2017-07-18 14:14:30 -04:00
committed by Tim Abbott
parent 1fd38e7e26
commit 7d49bb8dbd

View File

@@ -77,7 +77,14 @@ exports.insert_new_messages = function insert_new_messages(messages, local_id) {
activity.process_loaded_messages(messages);
message_util.do_unread_count_updates(messages);
exports.maybe_advance_to_recently_sent_message(messages);
unread_ops.process_visible();
notifications.received_messages(messages);
stream_list.update_streams_sidebar();
pm_list.update_private_messages();
};
exports.maybe_advance_to_recently_sent_message = function (messages) {
if (narrow_state.narrowed_by_reply()) {
// If you send a message when narrowed to a recipient, move the
// pointer to it.
@@ -100,11 +107,6 @@ exports.insert_new_messages = function insert_new_messages(messages, local_id) {
}
}
}
unread_ops.process_visible();
notifications.received_messages(messages);
stream_list.update_streams_sidebar();
pm_list.update_private_messages();
};
exports.update_messages = function update_messages(events) {