Just use message.unread when rendering.

By the time we render messages, we will have set message.unread,
so we don't need to calculate it from flags.

We add a line to the local-echo path to make this explicit
in that code.
This commit is contained in:
Steve Howell
2017-08-04 10:29:35 -04:00
committed by Tim Abbott
parent f81f9a26e8
commit 437cabe34c
2 changed files with 1 additions and 1 deletions

View File

@@ -90,6 +90,7 @@ function insert_local_message(message_request, local_id) {
// Locally delivered messages cannot be unread (since we sent them), nor
// can they alert the user.
message.flags = ['read']; // we may add more flags later
message.unread = false;
message.raw_content = message.content;

View File

@@ -249,7 +249,6 @@ MessageListView.prototype = {
message_container.contains_mention =
notifications.speaking_at_me(message_container.msg);
message_container.msg.unread = unread.message_unread(message_container.msg);
self._maybe_format_me_message(message_container);
prev = message_container;