sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 4e1e5c11fab83179ce611cc90d0b180c574eb3e0
parent a8b2732728d7999b350dce65cf4924ed781be727
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Wed,  9 Jun 2010 19:09:39 -0700

Merge branch 'master' into next

Diffstat:
M lib/sup/modes/thread-index-mode.rb | 2 +-
M lib/sup/thread.rb | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -231,7 +231,7 @@ EOS
     old_cursor_thread = cursor_thread
     @mutex.synchronize do
       ## let's see you do THIS in python
-      @threads = @ts.threads.select { |t| !@hidden_threads.member?(t) }.sort_by(&:sort_key)
+      @threads = @ts.threads.select { |t| !@hidden_threads.member?(t) }.select(&:has_message?).sort_by(&:sort_key)
       @size_widgets = @threads.map { |t| size_widget_for_thread t }
       @size_widget_width = @size_widgets.max_of { |w| w.display_length }
       @date_widgets = @threads.map { |t| date_widget_for_thread t }
diff --git a/lib/sup/thread.rb b/lib/sup/thread.rb
@@ -85,6 +85,7 @@ class Thread
   end
 
   def first; each { |m, *o| return m if m }; nil; end
+  def has_message?; any? { |m, *o| m.is_a? Message }; end
   def dirty?; any? { |m, *o| m && m.dirty? }; end
   def date; map { |m, *o| m.date if m }.compact.max; end
   def snippet