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.

recent_topics: Don't show topics from unsubscribed streams.

Aman Agrawal3e36fe6a1e5e
diff --git a/frontend_tests/node_tests/recent_topics.js b/frontend_tests/node_tests/recent_topics.js
index b42a8067962..0817cc4e65f 100644
--- a/frontend_tests/node_tests/recent_topics.js
+++ b/frontend_tests/node_tests/recent_topics.js
@@ -168,6 +168,7 @@ set_global("stream_data", {
// We only test via muted topics for now.
// TODO: Make muted streams and test them.
false,
+ id_is_subscribed: () => true,
});
let id = 0;
diff --git a/static/js/recent_topics.js b/static/js/recent_topics.js
index cad81c2f002..848bbefd1a8 100644
--- a/static/js/recent_topics.js
+++ b/static/js/recent_topics.js
@@ -264,9 +264,10 @@ exports.update_topics_of_deleted_message_ids = function (message_ids) {
exports.filters_should_hide_topic = function (topic_data) {
const msg = message_store.get(topic_data.last_msg_id);
+ const sub = stream_data.get_sub_by_id(msg.stream_id);
- if (stream_data.get_sub_by_id(msg.stream_id) === undefined) {
- // Never try to process deactivated streams.
+ if (sub === undefined || !sub.subscribed) {
+ // Never try to process deactivated & unsubscribed stream msgs.
return true;
}