Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

unread: Remove the TODO statement with an explanation.

Aman Agrawalfa4f9c7effb9
diff --git a/web/src/unread.js b/web/src/unread.js
index b53af0b87ad..ddc251c922c 100644
--- a/web/src/unread.js
+++ b/web/src/unread.js
@@ -283,12 +283,20 @@ class UnreadTopicCounter {
stream_count += topic_count;
}
- // TODO: These don't agree with the else clause in how
- // they handle muted streams/topics, and that's
- // probably a bug.
+ // Note: The format of res.stream_count is completely
+ // different from the else clause; with objects
+ // containing data for individual topics rather than
+ // just muted/unmuted totals, and all muted
+ // streams/topics included so that the inbox view can
+ // easily show/hide topics when its filters are
+ // adjusted. This should be refactored before the
+ // TypeScript migration for this file.
res.stream_count.set(stream_id, topic_unread);
res.stream_unread_messages += stream_count;
} else {
+ // get_stream_count calculates both the number of
+ // unmuted unread as well as the number of muted
+ // unreads.
res.stream_count.set(stream_id, this.get_stream_count(stream_id));
res.stream_unread_messages += res.stream_count.get(stream_id).unmuted_count;
}