From 8df42a729debc47bbe865eb5de3922dc15165916 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Mon, 25 Sep 2023 10:07:24 +0530 Subject: [PATCH] message_header: Remove the widget to change the visibility policy. This commit removes the widget to change the visibility policy for topics in unsubscribed streams. Earlier, users were able to change the visibility policy in an unsubscribed stream, which can lead to confusion. For example, a person might think that they would get notifications about new messages in the topic of the unsubscribed stream, which of course they wouldn't. --- web/src/message_list_view.js | 1 + web/templates/recipient_row.hbs | 47 +++++++++++++++++---------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/web/src/message_list_view.js b/web/src/message_list_view.js index 429dc67fd9..c62889e8e0 100644 --- a/web/src/message_list_view.js +++ b/web/src/message_list_view.js @@ -209,6 +209,7 @@ function populate_group_from_message_container(group, message_container) { group.stream_id = sub.stream_id; group.stream_muted = sub.is_muted; } + group.is_subscribed = stream_data.is_subscribed(group.stream_id); group.topic_is_resolved = resolved_topic.is_resolved(group.topic); group.topic_muted = user_topics.is_topic_muted(group.stream_id, group.topic); group.topic_unmuted = user_topics.is_topic_unmuted(group.stream_id, group.topic); diff --git a/web/templates/recipient_row.hbs b/web/templates/recipient_row.hbs index 2d79c11604..c2443defef 100644 --- a/web/templates/recipient_row.hbs +++ b/web/templates/recipient_row.hbs @@ -58,32 +58,33 @@ {{/if}} - {{#if development}} - - {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}} - - {{else if (eq visibility_policy all_visibility_policies.UNMUTED)}} - - {{else if (eq visibility_policy all_visibility_policies.MUTED)}} - - {{else}} - - {{/if}} - - {{else}} - {{#if stream_muted}} - + {{#if is_subscribed}} + {{#if development}} + + {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}} + + {{else if (eq visibility_policy all_visibility_policies.UNMUTED)}} + + {{else if (eq visibility_policy all_visibility_policies.MUTED)}} + + {{else}} + + {{/if}} + {{else}} - + {{#if stream_muted}} + + {{else}} + + {{/if}} {{/if}} {{/if}} - {{{date}}}