aboutsummaryrefslogtreecommitdiffstats
path: root/astroid/hooks/toggle-email-learn-spam
diff options
context:
space:
mode:
Diffstat (limited to 'astroid/hooks/toggle-email-learn-spam')
-rwxr-xr-xastroid/hooks/toggle-email-learn-spam11
1 files changed, 11 insertions, 0 deletions
diff --git a/astroid/hooks/toggle-email-learn-spam b/astroid/hooks/toggle-email-learn-spam
new file mode 100755
index 0000000..ae8d9d9
--- /dev/null
+++ b/astroid/hooks/toggle-email-learn-spam
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+#
+# $1 Message ID to toggle tag on
+
+if [[ "$(notmuch search id:$1 and tag:learn-spam)" ]]; then
+ printf "unsetting tag learn-spam from message %s\n" "$1"
+ notmuch tag -learn-spam +inbox id:"$1"
+else
+ printf "setting tag learn-spam from message %s\n" "$1"
+ notmuch tag +learn-spam -inbox id:"$1"
+fi