compose: Allow message_id to be passed into quote_and_reply.

Up until now, the currently selected message was the one that was always
quoted. Now if there's a message_id passed in, we'll quote that message
instead, otherwise we'll fall back on the selected message.

This is a prep commit for allowing quoting and replying while editing a
message sent earlier.
This commit is contained in:
N-Shar-ma
2023-10-06 03:00:37 +05:30
committed by Tim Abbott
parent 5ba178a54f
commit 0d4a74b2c2
3 changed files with 16 additions and 14 deletions

View File

@@ -126,8 +126,8 @@ export function reply_with_mention(opts) {
export function quote_and_reply(opts) {
const $textarea = $("textarea#compose-textarea");
const message_id = message_lists.current.selected_id();
const message = message_lists.current.selected_message();
const message_id = opts.message_id || message_lists.current.selected_id();
const message = message_lists.current.get(message_id);
const quoting_placeholder = $t({defaultMessage: "[Quoting…]"});
if (!compose_state.has_message_content()) {