compose: Allow message_id to be passed to respond_to_message.

Up until now, the currently selected message was the one that was always
responded to. Now if there's a message_id passed in, we'll use that
message instead, otherwise we'll fall back to 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 02:20:01 +05:30
committed by Tim Abbott
parent b363999d19
commit 5ba178a54f
2 changed files with 7 additions and 2 deletions

View File

@@ -42,7 +42,8 @@ export function respond_to_message(opts) {
}
message = message_opts.message;
} else {
message = message_lists.current.selected_message();
message =
message_lists.current.get(opts.message_id) || message_lists.current.selected_message();
if (message === undefined) {
// empty narrow implementation