aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorinwit <inwit@sindominio.net>2024-06-29 17:14:21 +0200
committerRobin Jarry <robin@jarry.cc>2024-08-20 11:54:34 +0200
commitb94b4c00c9c96355c411881b5e5cc42c5f83d159 (patch)
tree6369a6010c04f5db6772774575770c2dc949d844 /commands
parenta64563466ddcb9fc321b8dd540f929c979310af9 (diff)
downloadaerc-b94b4c00c9c96355c411881b5e5cc42c5f83d159.tar.gz
forward: allow forwarded flag to be set
Usually, a MUA sets a flag for messages that have been forwarded, but this is currently not the case for aerc. Consider the forwarded flag and prepare aerc to set it everytime the :forward command is called and ends successfully. Changelog-added: The :forward command now sets the forwarded flag. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands')
-rw-r--r--commands/completion_helpers.go2
-rw-r--r--commands/msg/forward.go11
2 files changed, 11 insertions, 2 deletions
diff --git a/commands/completion_helpers.go b/commands/completion_helpers.go
index 7f046630..92c33bea 100644
--- a/commands/completion_helpers.go
+++ b/commands/completion_helpers.go
@@ -45,7 +45,7 @@ func GetAddress(search string) []string {
// GetFlagList returns a list of available flags for completion
func GetFlagList() []string {
- return []string{"Seen", "Answered", "Flagged", "Draft"}
+ return []string{"Seen", "Answered", "Forwarded", "Flagged", "Draft"}
}
// GetDateList returns a list of date terms for completion
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index 2f108e8e..cb2cab35 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -162,7 +162,10 @@ func (f forward) Execute(args []string) error {
return
}
composer.AddAttachment(tmpFileName)
- composer.OnClose(func(_ *app.Composer) {
+ composer.OnClose(func(c *app.Composer) {
+ if c.Sent() {
+ store.Forwarded([]uint32{msg.Uid}, true, nil)
+ }
os.RemoveAll(tmpDir)
})
})
@@ -211,6 +214,12 @@ func (f forward) Execute(args []string) error {
return
}
+ composer.OnClose(func(c *app.Composer) {
+ if c.Sent() {
+ store.Forwarded([]uint32{msg.Uid}, true, nil)
+ }
+ })
+
// add attachments
if f.AttachAll {
var mu sync.Mutex