Subject: [sup-talk] [PATCH] Handle added messages in label-list-mode

From: [email-masked] (Bo Borgerson)
Date: Sat, 12 Sep 2009 17:04:05 -0400

Register label-list-mode with the UpdateManager and handle added
updates with a reload to keep unread message counts up to date
---
 lib/sup/modes/label-list-mode.rb |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib/sup/modes/label-list-mode.rb b/lib/sup/modes/label-list-mode.rb
index d94f56f..f0084a9 100644
--- a/lib/sup/modes/label-list-mode.rb
+++ b/lib/sup/modes/label-list-mode.rb
@@ -31,9 +31,15 @@ EOS
     @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
 
@@ -52,6 +58,10 @@ EOS
     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
-- 
1.6.0.4

---

From: [email-masked] (William Morgan)
Date: Thu, 01 Oct 2009 09:53:15 -0700

> updates with a reload to keep unread message counts up to date

Branch label-list-mode-auto-update, merged into next. I'm a little
concerned with performance, but we'll see how it goes.

What do you think about handling labeled and deleted updates as well?
-- 
William <wmorgan-sup at masanjin.net>