mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 07:52:19 +00:00
compose: Add banner for unmuting the muted topic a message is sent to.
We add a new banner informing the user if and when they send a message to a muted topic / stream. It also has a button to unmute the topic. Fixes: #24246.
This commit is contained in:
@@ -39,6 +39,7 @@ import * as transmit from "./transmit";
|
||||
import * as ui_report from "./ui_report";
|
||||
import * as upload from "./upload";
|
||||
import {user_settings} from "./user_settings";
|
||||
import * as user_topics from "./user_topics";
|
||||
import * as util from "./util";
|
||||
import * as zcommand from "./zcommand";
|
||||
|
||||
@@ -515,6 +516,28 @@ export function initialize() {
|
||||
},
|
||||
);
|
||||
|
||||
$("#compose_banners").on(
|
||||
"click",
|
||||
`.${CSS.escape(
|
||||
compose_banner.CLASSNAMES.unmute_topic_notification,
|
||||
)} .compose_banner_action_button`,
|
||||
(event) => {
|
||||
event.preventDefault();
|
||||
|
||||
const $target = $(event.target).parents(".compose_banner");
|
||||
const stream_id = Number.parseInt($target.attr("data-stream-id"), 10);
|
||||
const topic_name = $target.attr("data-topic-name");
|
||||
|
||||
user_topics.set_user_topic_visibility_policy(
|
||||
stream_id,
|
||||
topic_name,
|
||||
user_topics.all_visibility_policies.UNMUTED,
|
||||
false,
|
||||
true,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
$("#compose_banners").on(
|
||||
"click",
|
||||
`.${CSS.escape(
|
||||
|
||||
Reference in New Issue
Block a user