aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg
diff options
context:
space:
mode:
authorinwit <inwit@sindominio.net>2024-10-21 21:03:49 +0200
committerRobin Jarry <robin@jarry.cc>2024-10-21 23:25:44 +0200
commit29f95c68e26df5391a90068d1646a8afe8f65316 (patch)
tree5b8eddef55554b757838ffba1f174e96a0f45187 /commands/msg
parente5354e8ec8833b25692fffb958517c3a27f79b5a (diff)
downloadaerc-29f95c68e26df5391a90068d1646a8afe8f65316.tar.gz
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 <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg')
-rw-r--r--commands/msg/invite.go10
1 files changed, 9 insertions, 1 deletions
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)
}
})