Add explicit message field for locally_echoed.

We now set locally_echoed to true for messages that are
locally echoed, and we change some of our code to look
for this flag.
This commit is contained in:
Steve Howell
2017-07-17 10:52:57 -04:00
committed by Tim Abbott
parent fca158e387
commit 0e25055c1d
10 changed files with 23 additions and 17 deletions

View File

@@ -96,9 +96,11 @@ exports.initialize = function initialize() {
// Additionally, don't advance the pointer server-side
// if the selected message is local-only
if (event.msg_list === home_msg_list && page_params.narrow_stream === undefined) {
if (event.id > pointer.furthest_read &&
home_msg_list.get(event.id).local_id === undefined) {
pointer.furthest_read = event.id;
if (event.id > pointer.furthest_read) {
var msg = home_msg_list.get(event.id);
if (!msg.locally_echoed) {
pointer.furthest_read = event.id;
}
}
}