sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit c5b3f02274517ba5a5868b00c2875ccf47241696
parent bfe40c05dc6dc2656a4dde11948ff617f2fa00d6
Author: Bo Borgerson <gigabo@gmail.com>
Date:   Sat, 12 Sep 2009 17:04:05 -0400

handle added messages in label-list-mode

Register label-list-mode with the UpdateManager and handle added
updates with a reload to keep unread message counts up to date

Diffstat:
M lib/sup/modes/label-list-mode.rb | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/label-list-mode.rb b/lib/sup/modes/label-list-mode.rb
@@ -13,9 +13,15 @@ class LabelListMode < LineCursorMode
     @text = []
     @unread_only = false
     super
+    UpdateManager.register self
     regen_text
   end
 
+  def cleanup
+    UpdateManager.unregister self
+    super
+  end
+
   def lines; @text.length end
   def [] i; @text[i] end
 
@@ -34,6 +40,10 @@ class LabelListMode < LineCursorMode
     reload # make sure unread message counts are up-to-date
   end
 
+  def handle_added_update sender, m
+    reload
+  end
+
 protected
 
   def toggle_show_unread_only