aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/reply.go
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2023-01-03 12:13:14 +0100
committerRobin Jarry <robin@jarry.cc>2023-01-04 22:57:25 +0100
commit36fded03e762da97edde61559c8bf60d5749d6a2 (patch)
tree6a55c921e71390f550b56a8c222d17487e433983 /commands/msg/reply.go
parenta42042f494cc3a3e7a34bc13525c7a95cad3174f (diff)
downloadaerc-36fded03e762da97edde61559c8bf60d5749d6a2.tar.gz
send: add option to send&archive
Add `:send -a flat|month|year` to send, which archives the message being replied to. Extract most of archive logic into a separate function to make sure it behaves as manual archiving. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg/reply.go')
-rw-r--r--commands/msg/reply.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 8f536c14..52265950 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -7,6 +7,7 @@ import (
"io"
"regexp"
"strings"
+ "time"
"git.sr.ht/~sircmpwn/getopt"
@@ -210,6 +211,12 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
composer.OnClose(func(c *widgets.Composer) {
switch {
+ case c.Sent() && c.Archive() != "":
+ store.Answered([]uint32{msg.Uid}, true, nil)
+ err := archive(aerc, []*models.MessageInfo{msg}, c.Archive())
+ if err != nil {
+ aerc.PushStatus("Archive failed", 10*time.Second)
+ }
case c.Sent():
store.Answered([]uint32{msg.Uid}, true, nil)
case mv != nil && closeOnReply: