Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

compose: Remove "stream" mention in case of PMs.

somesh202b4aeb7a62286
diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.js
index 32f72f03dab..867cef67209 100644
--- a/frontend_tests/node_tests/composebox_typeahead.js
+++ b/frontend_tests/node_tests/composebox_typeahead.js
@@ -79,7 +79,7 @@ run_test("verify wildcard mentions typeahead for stream message", () => {
run_test("verify wildcard mentions typeahead for private message", () => {
compose_state.set_message_type("private");
- assert.equal(ct.broadcast_mentions().length, 3);
+ assert.equal(ct.broadcast_mentions().length, 2);
const mention_all = ct.broadcast_mentions()[0];
const mention_everyone = ct.broadcast_mentions()[1];
assert.equal(mention_all.email, "all");
diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.js
index d8be433f58f..b523427b128 100644
--- a/static/js/composebox_typeahead.js
+++ b/static/js/composebox_typeahead.js
@@ -343,13 +343,15 @@ export function tokenize_compose_str(s) {
}
export function broadcast_mentions() {
+ const wildcard_mention_array = ["all", "everyone"];
let wildcard_string = "";
if (compose_state.get_message_type() === "private") {
wildcard_string = $t({defaultMessage: "Notify recipients"});
} else {
wildcard_string = $t({defaultMessage: "Notify stream"});
+ wildcard_mention_array.push("stream");
}
- return ["all", "everyone", "stream"].map((mention, idx) => ({
+ return wildcard_mention_array.map((mention, idx) => ({
special_item_text: `${mention} (${wildcard_string})`,
email: mention,