aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/recall.go
diff options
context:
space:
mode:
authorJason Cox <me@jasoncarloscox.com>2023-10-29 17:40:47 -0400
committerRobin Jarry <robin@jarry.cc>2023-11-02 11:59:39 +0100
commit31b50f24d51fd429f30e20fb42a5681149e5bfe7 (patch)
tree3698ffa2662a04655a042769a23d4a07ccebd4c4 /commands/msg/recall.go
parentfb8e60c041d7b4a61e5862d6bce6fd3bd8fca000 (diff)
downloadaerc-31b50f24d51fd429f30e20fb42a5681149e5bfe7.tar.gz
hooks: add mail-deleted hook
The mail-deleted hook runs whenever a message is deleted from a folder. Note that this means moving a message from one folder to another triggers the mail-deleted hook. Changelog-added: `mail-deleted` hook that triggers when a message is removed/moved from a folder. References: https://todo.sr.ht/~rjarry/aerc/136 Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg/recall.go')
-rw-r--r--commands/msg/recall.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/commands/msg/recall.go b/commands/msg/recall.go
index cea02ddb..a676010a 100644
--- a/commands/msg/recall.go
+++ b/commands/msg/recall.go
@@ -61,20 +61,20 @@ func (r Recall) Execute(args []string) error {
}
composer.Tab = app.NewTab(composer, subject)
composer.OnClose(func(composer *app.Composer) {
- worker := composer.Worker()
uids := []uint32{msgInfo.Uid}
deleteMessage := func() {
- worker.PostAction(&types.DeleteMessages{
- Uids: uids,
- }, func(msg types.WorkerMessage) {
- switch msg := msg.(type) {
- case *types.Done:
- app.PushStatus("Recalled message deleted", 10*time.Second)
- case *types.Error:
- app.PushError(msg.Error.Error())
- }
- })
+ store.Delete(
+ uids,
+ func(msg types.WorkerMessage) {
+ switch msg := msg.(type) {
+ case *types.Done:
+ app.PushStatus("Recalled message deleted", 10*time.Second)
+ case *types.Error:
+ app.PushError(msg.Error.Error())
+ }
+ },
+ )
}
if composer.Sent() || composer.Postponed() {