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:
Steve Howell
2018-12-13 21:26:10 +00:00
committed by Tim Abbott
parent 69da22d998
commit a8718c9051
15 changed files with 149 additions and 84 deletions

View File

@@ -142,7 +142,7 @@ function build_topic_popover(e) {
popovers.hide_all();
exports.show_streamlist_sidebar();
var is_muted = muting.is_topic_muted(sub.name, topic_name);
var is_muted = muting.is_topic_muted(sub.stream_id, topic_name);
var can_mute_topic = !is_muted;
var can_unmute_topic = is_muted;