mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
muting: Use stream_id for internal data structures.
This fixes the most core data structures inside of muting.js. We still use stream names for incoming data to set_muted_topics and outgoing data from get_muted_topics. This will make us more resilient to stream name changes. Before, if you were logged on when a stream rename occured, topics that were muted under that stream would appear to be unmuted. (You could fix it with a reload, but it can be jarring to have a bunch of unread messages appear in your feed suddenly.) Fixes #11033
This commit is contained in:
@@ -298,7 +298,7 @@ exports.unread_topic_counter = (function () {
|
||||
per_stream_bucketer.each(function (msgs, topic) {
|
||||
var topic_count = msgs.count();
|
||||
res.topic_count.get(stream_id).set(topic, topic_count);
|
||||
if (!muting.is_topic_muted(sub.name, topic)) {
|
||||
if (!muting.is_topic_muted(stream_id, topic)) {
|
||||
stream_count += topic_count;
|
||||
}
|
||||
});
|
||||
@@ -350,7 +350,7 @@ exports.unread_topic_counter = (function () {
|
||||
|
||||
var sub = stream_data.get_sub_by_id(stream_id);
|
||||
per_stream_bucketer.each(function (msgs, topic) {
|
||||
if (sub && !muting.is_topic_muted(sub.name, topic)) {
|
||||
if (sub && !muting.is_topic_muted(stream_id, topic)) {
|
||||
stream_count += msgs.count();
|
||||
}
|
||||
});
|
||||
@@ -382,7 +382,7 @@ exports.unread_topic_counter = (function () {
|
||||
var topic_lists = [];
|
||||
var sub = stream_data.get_sub_by_id(stream_id);
|
||||
per_stream_bucketer.each(function (msgs, topic) {
|
||||
if (sub && !muting.is_topic_muted(sub.name, topic)) {
|
||||
if (sub && !muting.is_topic_muted(stream_id, topic)) {
|
||||
topic_lists.push(msgs.members());
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user