aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hooks
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-04-10 20:08:00 +0200
committerRobin Jarry <robin@jarry.cc>2024-04-14 11:50:39 +0200
commitcee5d5a3f602e5db0ca3feb6e0754c1bb0059f36 (patch)
treec380b0cb317a62d17b6ff4922fbc6c95486f3295 /lib/hooks
parentae3f7419ce1b6d4a81c4f240ff1073ba45f45b52 (diff)
downloadaerc-cee5d5a3f602e5db0ca3feb6e0754c1bb0059f36.tar.gz
hooks: add tag-modified
Add the tag-modified hook for notmuch and JMAP accounts. References: https://todo.sr.ht/~rjarry/aerc/136 Changelog-added: New `tag-modified` hook for notmuch and JMAP accounts. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/hooks')
-rw-r--r--lib/hooks/tag-modified.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/hooks/tag-modified.go b/lib/hooks/tag-modified.go
new file mode 100644
index 00000000..44af9471
--- /dev/null
+++ b/lib/hooks/tag-modified.go
@@ -0,0 +1,27 @@
+package hooks
+
+import (
+ "fmt"
+
+ "git.sr.ht/~rjarry/aerc/config"
+)
+
+type TagModified struct {
+ Account string
+ Add []string
+ Remove []string
+}
+
+func (m *TagModified) Cmd() string {
+ return config.Hooks.TagModified
+}
+
+func (m *TagModified) Env() []string {
+ env := []string{
+ fmt.Sprintf("AERC_ACCOUNT=%s", m.Account),
+ fmt.Sprintf("AERC_TAG_ADDED=%v", m.Add),
+ fmt.Sprintf("AERC_TAG_REMOVED=%v", m.Remove),
+ }
+
+ return env
+}