sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 831f27f2469e8a84814bdca2de8ceaeaa15cb757
parent d01068fb697691781e46db371f1e85148ad98684
Author: Anthony Martinez <pi+sup@pihost.us>
Date:   Thu, 31 Dec 2009 13:45:30 -0700

move the mark-as-spam hook so it runs on all tagged threads

This way, tagging a whole bunch of spam and then hitting =S will get
them all run through bogofilter (or whatever is done in the mark-as-spam
hook) instead of only the currently selected one.

Diffstat:
M lib/sup/modes/thread-index-mode.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -406,7 +406,6 @@ 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
@@ -418,6 +417,7 @@ EOS
   ## you also want them to disappear immediately.
   def multi_toggle_spam threads
     undos = threads.map { |t| actually_toggle_spammed t }
+    threads.each { |t| HookManager.run("mark-as-spam", :thread => t) }
     UndoManager.register "marking/unmarking  #{threads.size.pluralize 'thread'} as spam",
                          undos, lambda { regen_text }
     regen_text