sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit fb0b41fdf626272c0b2181113d0a8143821e3ce0
parent e0a8d26d8525ad64c019d74455440172eac74404
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Tue, 18 Dec 2007 20:34:12 -0800

added num_inbox_total_unread variable to after-poll hook

Diffstat:
M lib/sup/poll.rb | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
@@ -19,12 +19,13 @@ EOS
   HookManager.register "after-poll", <<EOS
 Executes immediately after a poll for new messages completes.
 Variables:
-                  num: the total number of new messages
-            num_inbox: the number of new messages appearing in the inbox (i.e.
-                       not auto-archived).
-        from_and_subj: an array of (from email address, subject) pairs
-  from_and_subj_inbox: an array of (from email address, subject) pairs for
-                       only those messages appearing in the inbox
+                   num: the total number of new messages added in this poll
+             num_inbox: the number of new messages added in this poll which
+                        appear in the inbox (i.e. were not auto-archived).
+num_inbox_total_unread: the total number of unread messages in the inbox
+         from_and_subj: an array of (from email address, subject) pairs
+   from_and_subj_inbox: an array of (from email address, subject) pairs for
+                        only those messages appearing in the inbox
 EOS
 
   DELAY = 300
@@ -56,7 +57,7 @@ EOS
       BufferManager.flash "No new messages." 
     end
 
-    HookManager.run "after-poll", :num => num, :num_inbox => numi, :from_and_subj => from_and_subj, :from_and_subj_inbox => from_and_subj_inbox
+    HookManager.run "after-poll", :num => num, :num_inbox => numi, :from_and_subj => from_and_subj, :from_and_subj_inbox => from_and_subj_inbox, :num_inbox_total_unread => lambda { Index.num_results_for :labels => [:inbox, :unread] }
 
     @polling = false
     [num, numi]