recent_topics: Don't show topics from unsubscribed streams.

This commit is contained in:
Aman Agrawal
2021-01-06 14:23:07 +00:00
committed by Tim Abbott
parent 017fbe3fe4
commit 3e36fe6a1e
2 changed files with 4 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;
}