mirror of https://github.com/zulip/zulip.git
recent: Add support for unmuted topics within muted streams.
This commit refactors the logic of message filtering for 'Recent conversations' narrow. Previously, we used to filter the recent conversations messages based on the state of the stream and topic. If the stream or topic was muted, we would avoid displaying the message. However, with the new changes, we check if the topic is unmuted before applying the aforementioned condition. If the topic is unmuted, we add the message to the all 'Recent conversations' narrow. Fixes part of: #24243
This commit is contained in:
parent
ed4de6da4a
commit
acb4d7efa6
|
@ -541,9 +541,11 @@ export function filters_should_hide_topic(topic_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filters.has("include_muted") && topic_data.type === "stream") {
|
if (!filters.has("include_muted") && topic_data.type === "stream") {
|
||||||
|
// We want to show the unmuted topics within muted streams in the recent topics.
|
||||||
|
const topic_unmuted = Boolean(user_topics.is_topic_unmuted(msg.stream_id, msg.topic));
|
||||||
const topic_muted = Boolean(user_topics.is_topic_muted(msg.stream_id, msg.topic));
|
const topic_muted = Boolean(user_topics.is_topic_muted(msg.stream_id, msg.topic));
|
||||||
const stream_muted = stream_data.is_muted(msg.stream_id);
|
const stream_muted = stream_data.is_muted(msg.stream_id);
|
||||||
if (topic_muted || stream_muted) {
|
if (topic_muted || (stream_muted && !topic_unmuted)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,6 +107,7 @@ mock_esm("../src/user_topics", {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
is_topic_unmuted: () => false,
|
||||||
});
|
});
|
||||||
const narrow = mock_esm("../src/narrow", {
|
const narrow = mock_esm("../src/narrow", {
|
||||||
update_narrow_title: noop,
|
update_narrow_title: noop,
|
||||||
|
|
Loading…
Reference in New Issue