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.

quote: s/quote_message/quote_messages

apoorvapendse4f1ba9af519d
diff --git a/web/src/compose_reply.ts b/web/src/compose_reply.ts
index 7c10db2090c..047e15fdbbb 100644
--- a/web/src/compose_reply.ts
+++ b/web/src/compose_reply.ts
@@ -435,7 +435,7 @@ function replace_quoting_placeholder_with(content: string, forward_message?: boo
}
}
-export function quote_message(opts: QuoteMessageOpts): void {
+export function quote_messages(opts: QuoteMessageOpts): void {
if (opts.message_id) {
quote_single_message(opts);
return;
diff --git a/web/src/hotkey.ts b/web/src/hotkey.ts
index 516696b7a42..492acd53b84 100644
--- a/web/src/hotkey.ts
+++ b/web/src/hotkey.ts
@@ -1497,10 +1497,10 @@ function process_hotkey(e: JQuery.KeyDownEvent, hotkey: Hotkey): boolean {
unread_ops.mark_as_unread_from_here(msg.id);
return true;
case "compose_quote_message": // > : respond to selected message with quote
- compose_reply.quote_message({trigger: "hotkey"});
+ compose_reply.quote_messages({trigger: "hotkey"});
return true;
case "compose_forward_message": // < : forward selected message
- compose_reply.quote_message({trigger: "hotkey", forward_message: true});
+ compose_reply.quote_messages({trigger: "hotkey", forward_message: true});
return true;
case "edit_message": {
const $row = message_lists.current.get_row(msg.id);
diff --git a/web/src/message_actions_popover.ts b/web/src/message_actions_popover.ts
index 2daf55f5a28..6128486abaf 100644
--- a/web/src/message_actions_popover.ts
+++ b/web/src/message_actions_popover.ts
@@ -124,7 +124,7 @@ export function initialize({
// instance.hide gets called.
const $popper = $(instance.popper);
$popper.one("click", ".respond_button", (e) => {
- compose_reply.quote_message({
+ compose_reply.quote_messages({
trigger: "popover respond",
message_id,
quote_content,
@@ -135,7 +135,7 @@ export function initialize({
});
$popper.one("click", ".forward_button", (e) => {
- compose_reply.quote_message({
+ compose_reply.quote_messages({
trigger: "popover respond",
message_id,
quote_content,
diff --git a/web/tests/compose_actions.test.cjs b/web/tests/compose_actions.test.cjs
index dccfe3df3c3..e089e51b7e8 100644
--- a/web/tests/compose_actions.test.cjs
+++ b/web/tests/compose_actions.test.cjs
@@ -130,7 +130,7 @@ const start = compose_actions.start;
const cancel = compose_actions.cancel;
const respond_to_message = compose_reply.respond_to_message;
const reply_with_mention = compose_reply.reply_with_mention;
-const quote_message = compose_reply.quote_message;
+const quote_messages = compose_reply.quote_messages;
function assert_visible(sel) {
assert.ok($(sel).visible());
@@ -461,7 +461,7 @@ test("reply_with_mention", ({override, override_rewire, mock_template}) => {
assert.equal(syntax_to_insert, "@**Bob Roberts|40**");
});
-test("quote_message", ({disallow, override, override_rewire}) => {
+test("quote_messages", ({disallow, override, override_rewire}) => {
override_rewire(compose_recipient, "on_compose_select_recipient_update", noop);
override_rewire(compose_recipient, "update_recipient_row_attention_level", noop);
override_rewire(compose_reply, "get_highlighted_message_ids", () => undefined);
@@ -576,7 +576,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
fence: "```",
content: "Testing.",
});
- quote_message(opts);
+ quote_messages(opts);
run_success_callback();
assert.ok(replaced);
@@ -597,7 +597,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
content: "Testing.",
});
- quote_message(opts);
+ quote_messages(opts);
run_success_callback();
assert.ok(replaced);
@@ -626,7 +626,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
});
disallow(message_fetch_raw_content, "get_raw_content_for_single_message");
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
opts = {
@@ -641,7 +641,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
fence: "```",
content: "Testing.",
});
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
opts = {
@@ -667,7 +667,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
content: selected_message.raw_content,
});
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
opts = {
@@ -681,7 +681,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
fence: "````",
content: selected_message.raw_content,
});
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
// Group direct message to 3 other users
@@ -715,7 +715,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
override(message_lists.current, "get", (id) =>
id === selected_message.id ? selected_message : undefined,
);
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
// Group direct message to only 2 other users
@@ -749,7 +749,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
override(message_lists.current, "get", (id) =>
id === selected_message.id ? selected_message : undefined,
);
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
// Other's group direct message
@@ -783,7 +783,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
override(message_lists.current, "get", (id) =>
id === selected_message.id ? selected_message : undefined,
);
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
// Direct message to other user
@@ -817,7 +817,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
override(message_lists.current, "get", (id) =>
id === selected_message.id ? selected_message : undefined,
);
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
// Other user's direct message
@@ -851,7 +851,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
override(message_lists.current, "get", (id) =>
id === selected_message.id ? selected_message : undefined,
);
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
// One's own direct message
@@ -885,7 +885,7 @@ test("quote_message", ({disallow, override, override_rewire}) => {
override(message_lists.current, "get", (id) =>
id === selected_message.id ? selected_message : undefined,
);
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
const topic_with_invalid_characters = "[zulip/zulip>topic]";
@@ -922,7 +922,7 @@ ${fence}`;
override(message_lists.current, "get", (id) =>
id === selected_message.id ? selected_message : undefined,
);
- quote_message(opts);
+ quote_messages(opts);
assert.ok(replaced);
// Quoting a highlighted(selected) part of a message using the ">" hotkey trigger
@@ -954,7 +954,7 @@ ${fence}`;
content: "Hello world",
});
override(message_lists.current, "get", (id) => (id === 50 ? highlighted_message : undefined));
- quote_message(opts);
+ quote_messages(opts);
const {opts: opts_when_message_has_selection} = stub.get_args("opts");
assert.equal(opts_when_message_has_selection.trigger, "hotkey");
assert.equal(opts_when_message_has_selection.message_id, 50);
@@ -975,7 +975,7 @@ ${fence}`;
fence: "```",
content: message_with_pointer.raw_content,
});
- quote_message(opts);
+ quote_messages(opts);
const {opts: opts_when_message_has_no_selection} = stub.get_args("opts");
assert.equal(opts_when_message_has_no_selection.trigger, "hotkey");
assert.equal(opts_when_message_has_no_selection.message_id, 100);
diff --git a/web/tests/compose_ui.test.cjs b/web/tests/compose_ui.test.cjs
index 90c3baa307d..9b5ccb10a02 100644
--- a/web/tests/compose_ui.test.cjs
+++ b/web/tests/compose_ui.test.cjs
@@ -556,7 +556,7 @@ run_test("quote_message", ({override, override_rewire}) => {
let quote_text = "Testing caret position";
override_with_quote_text(quote_text);
set_compose_content_with_caret("hello %there"); // "%" is used to encode/display position of focus before change
- compose_reply.quote_message({message_id: 100});
+ compose_reply.quote_messages({message_id: 100});
run_success_callback();
reset_test_state();
@@ -568,7 +568,7 @@ run_test("quote_message", ({override, override_rewire}) => {
assert.equal(syntax, "translated: [Quoting…]\n\n");
});
set_compose_content_with_caret("%hello there");
- compose_reply.quote_message({message_id: 100});
+ compose_reply.quote_messages({message_id: 100});
quote_text = "Testing with caret initially positioned at 0.";
override_with_quote_text(quote_text);
@@ -588,7 +588,7 @@ run_test("quote_message", ({override, override_rewire}) => {
// at the beginning of compose-box.
override(message_lists.current, "selected_id", () => 100);
override_rewire(compose_reply, "get_highlighted_message_ids", () => undefined);
- compose_reply.quote_message({});
+ compose_reply.quote_messages({});
quote_text = "Testing with compose-box closed initially.";
override_with_quote_text(quote_text);
@@ -601,7 +601,7 @@ run_test("quote_message", ({override, override_rewire}) => {
// newlines), the compose-box should re-open and thus the quoted
// message should start from the beginning of compose-box.
set_compose_content_with_caret(" \n\n \n %");
- compose_reply.quote_message({});
+ compose_reply.quote_messages({});
quote_text = "Testing with compose-box containing whitespaces and newlines only.";
override_with_quote_text(quote_text);
@@ -619,7 +619,7 @@ run_test("quote_message", ({override, override_rewire}) => {
});
set_compose_content_with_caret("hello %there");
- compose_reply.quote_message({forward_message: true});
+ compose_reply.quote_messages({forward_message: true});
assert.ok(new_message);
override_with_forward_text(quote_text);
@@ -634,7 +634,7 @@ run_test("quote_message", ({override, override_rewire}) => {
assert.equal(syntax, "\ntranslated: [Quoting…]\n");
});
set_compose_content_with_caret("1st line\n%\n2nd line");
- compose_reply.quote_message({});
+ compose_reply.quote_messages({});
quote_text = "Testing with caret on a new line between 2 lines of text.";
override_with_quote_text(quote_text);
@@ -649,7 +649,7 @@ run_test("quote_message", ({override, override_rewire}) => {
assert.equal(syntax, "translated: [Quoting…]");
});
set_compose_content_with_caret("lots of\n\n\n\n%\n\n\nnewlines");
- compose_reply.quote_message({});
+ compose_reply.quote_messages({});
quote_text = "Testing with caret on a new line between many empty newlines.";
override_with_quote_text(quote_text);
diff --git a/web/tests/hotkey.test.cjs b/web/tests/hotkey.test.cjs
index 079bcba25a0..caec51e7cef 100644
--- a/web/tests/hotkey.test.cjs
+++ b/web/tests/hotkey.test.cjs
@@ -490,8 +490,8 @@ test_while_not_editing_text("misc", ({override}) => {
assert_mapping("u", popovers, "toggle_sender_info");
assert_mapping("i", message_actions_popover, "toggle_message_actions_menu");
assert_mapping(":", emoji_picker, "start_picker_for_message_reaction", true);
- assert_mapping(">", compose_reply, "quote_message");
- assert_mapping("<", compose_reply, "quote_message");
+ assert_mapping(">", compose_reply, "quote_messages");
+ assert_mapping("<", compose_reply, "quote_messages");
assert_mapping("e", message_edit, "start");
override(