From 29f95c68e26df5391a90068d1646a8afe8f65316 Mon Sep 17 00:00:00 2001 From: inwit Date: Mon, 21 Oct 2024 21:03:49 +0200 Subject: invite: honor the -a flag for :send When sending replies to invitations with :accept, :accept-tentative or :decline, calling `:send -a` in the review screen does not archive the original invitation, as it should. Solve this situation and allow for directly archiving invitations after replying to them. Changelog-fixed: Invitations now honor the -a flag for :send. Signed-off-by: inwit Acked-by: Robin Jarry --- commands/msg/invite.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'commands/msg/invite.go') diff --git a/commands/msg/invite.go b/commands/msg/invite.go index a6ffb90b..9a236e24 100644 --- a/commands/msg/invite.go +++ b/commands/msg/invite.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "io" + "time" "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" @@ -141,7 +142,14 @@ func (i invite) Execute(args []string) error { composer.Tab = app.NewTab(composer, subject) composer.OnClose(func(c *app.Composer) { - if c.Sent() { + switch { + case c.Sent() && c.Archive() != "": + store.Answered([]models.UID{msg.Uid}, true, nil) + err := archive([]*models.MessageInfo{msg}, nil, c.Archive()) + if err != nil { + app.PushStatus("Archive failed", 10*time.Second) + } + case c.Sent(): store.Answered([]models.UID{msg.Uid}, true, nil) } }) -- cgit