aboutsummaryrefslogtreecommitdiffstats
path: root/app/account.go
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-04-10 20:08:01 +0200
committerRobin Jarry <robin@jarry.cc>2024-04-14 11:51:00 +0200
commit939000ccf2c3e54d1d50d3ae3f5b4e06a3fa3b69 (patch)
treecec40ad16557021aabdb9a99fdda358a8101e4ec /app/account.go
parentcee5d5a3f602e5db0ca3feb6e0754c1bb0059f36 (diff)
downloadaerc-939000ccf2c3e54d1d50d3ae3f5b4e06a3fa3b69.tar.gz
hooks: add flag-changed
Add the flag-changed hook. References: https://todo.sr.ht/~rjarry/aerc/136 Changelog-added: New `flag-changed` hook. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app/account.go')
-rw-r--r--app/account.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/account.go b/app/account.go
index 99739f01..ab5793bc 100644
--- a/app/account.go
+++ b/app/account.go
@@ -292,6 +292,16 @@ func (acct *AccountView) newStore(name string) *lib.MessageStore {
msg := fmt.Sprintf("tag-modified hook: %s", err)
PushError(msg)
}
+ }, func(flagname string) {
+ err := hooks.RunHook(&hooks.FlagChanged{
+ Account: acct.Name(),
+ Folder: acct.SelectedDirectory(),
+ FlagName: flagname,
+ })
+ if err != nil {
+ msg := fmt.Sprintf("flag-changed hook: %s", err)
+ PushError(msg)
+ }
},
acct.updateSplitView,
acct.dirlist.UiConfig(name).ThreadContext,