mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
Fix how we find if streams are muted.
This commit changes stream_data.in_home_view() to take a stream_id parameter, which will make it more robust to stream name changes. This fixes a bug. Now when an admin renames a stream you are looking at, it will correctly show itself to be un-muted. (Even with this fix, though, the stream appears to be inactive.) Some callers still do lookups by name, and they will call name_in_home_view() for now, which we can hopefully deprecate over time.
This commit is contained in:
@@ -417,7 +417,7 @@ function message_is_notifiable(message) {
|
||||
return true;
|
||||
}
|
||||
if ((message.type === "stream") &&
|
||||
!stream_data.in_home_view(message.stream)) {
|
||||
!stream_data.in_home_view(message.stream_id)) {
|
||||
return false;
|
||||
}
|
||||
if ((message.type === "stream") &&
|
||||
@@ -548,7 +548,7 @@ exports.possibly_notify_new_messages_outside_viewport = function (messages, loca
|
||||
if (row.length === 0) {
|
||||
if (message.type === "stream" && muting.is_topic_muted(message.stream, message.subject)) {
|
||||
note = "Sent! Your message was sent to a topic you have muted.";
|
||||
} else if (message.type === "stream" && !stream_data.in_home_view(message.stream)) {
|
||||
} else if (message.type === "stream" && !stream_data.in_home_view(message.stream_id)) {
|
||||
note = "Sent! Your message was sent to a stream you have muted.";
|
||||
} else {
|
||||
// offscreen because it is outside narrow
|
||||
|
||||
Reference in New Issue
Block a user