unread: Avoid use of opaque message.

We only care about ~8 fields from a Zulip message
when we're tracking unread counts. For example, we
don't care about the "content" field. This also sets
us up to pull up the "display_recipient" logic in an
upcoming commit.
This commit is contained in:
Steve Howell 2021-08-04 17:04:29 +00:00 committed by Tim Abbott
parent 80edf7456c
commit f7e5847b5c
1 changed files with 10 additions and 1 deletions

View File

@ -426,7 +426,16 @@ export function update_unread_topics(msg, event) {
export function process_loaded_messages(messages) { export function process_loaded_messages(messages) {
for (const message of messages) { for (const message of messages) {
if (message.unread) { if (message.unread) {
process_unread_message(message); process_unread_message({
display_recipient: message.display_recipient,
id: message.id,
mentioned: message.mentioned,
mentioned_me_directly: message.mentioned_me_directly,
stream_id: message.stream_id,
topic: message.topic,
type: message.type,
unread: true,
});
} }
} }
} }