inbox: Set compose recipient according to focused row on reply.

Fill compose recipient based on the latest message of the focused
row.
This commit is contained in:
Aman Agrawal
2023-10-06 21:36:20 +00:00
committed by Tim Abbott
parent 50a356389c
commit 2561e7f2d8
2 changed files with 34 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ import * as compose_state from "./compose_state";
import * as compose_ui from "./compose_ui";
import * as hash_util from "./hash_util";
import {$t} from "./i18n";
import * as inbox_ui from "./inbox_ui";
import * as inbox_util from "./inbox_util";
import * as message_lists from "./message_lists";
import * as narrow_state from "./narrow_state";
import * as people from "./people";
@@ -27,6 +29,14 @@ export function respond_to_message(opts) {
compose_actions.start("stream", {trigger: "recent_view_nofocus"});
return;
}
} else if (inbox_util.is_visible()) {
message = inbox_ui.get_focused_row_message();
if (message === undefined) {
// Open empty compose with nothing pre-filled since
// user is not focused on any table row.
compose_actions.start("stream", {trigger: "inbox_nofocus"});
return;
}
} else {
message = message_lists.current.selected_message();