sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit ade82bd7cde0631efb335a20cdb1c137387cad74
parent affc5b3e5f1e50f477f58b6e95e35c13e8a1dd8c
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Wed, 30 Jul 2008 17:26:50 -0700

Merge commit 'origin/mark-as-spam-hook'

Diffstat:
M lib/sup/modes/thread-index-mode.rb | 7 +++++++
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -14,6 +14,12 @@ Variables:
   thread: The message thread to be formatted.
 EOS
 
+  HookManager.register "mark-as-spam", <<EOS
+This hook is run when a thread is marked as spam
+Variables:
+  thread: The message thread being marked as spam.
+EOS
+
   register_keymap do |k|
     k.add :load_threads, "Load #{LOAD_MORE_THREAD_NUM} more threads", 'M'
     k.add_multi "Load all threads (! to confirm) :", '!' do |kk|
@@ -333,6 +339,7 @@ EOS
   def toggle_spam
     t = cursor_thread or return
     multi_toggle_spam [t]
+    HookManager.run("mark-as-spam", :thread => t)
   end
 
   ## both spam and deleted have the curious characteristic that you