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