]> git.cworth.org Git - sup/commitdiff
bugfix for expand new messages
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 15 Mar 2007 20:34:29 +0000 (20:34 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 15 Mar 2007 20:34:29 +0000 (20:34 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@349 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/thread-view-mode.rb

index 2ed4dc99de6fa8e9f48e437a2360729f0149ef2f..3ef7d816dc2699e1eee63cfce82127c00fbb6ab0 100644 (file)
@@ -3,7 +3,7 @@ module Redwood
 class ThreadViewMode < LineCursorMode
   ## this holds all info we need to lay out a message
   class Layout
-    attr_accessor :top, :bot, :prev, :next, :depth, :width, :state, :color
+    attr_accessor :top, :bot, :prev, :next, :depth, :width, :state, :color, :orig_new
   end
 
   DATE_FORMAT = "%B %e %Y %l:%M%P"
@@ -53,6 +53,7 @@ class ThreadViewMode < LineCursorMode
       @layout[m] = Layout.new
       @layout[m].state = initial_state_for m
       @layout[m].color = altcolor ? :alternate_patina_color : :message_patina_color
+      @layout[m].orig_new = m.has_label? :unread
       altcolor = !altcolor
       if latest_date.nil? || m.date > latest_date
         latest_date = m.date
@@ -239,7 +240,7 @@ class ThreadViewMode < LineCursorMode
   end
 
   def collapse_non_new_messages
-    @layout.each { |m, l| l.state = m.has_label?(:unread) ? :open : :closed }
+    @layout.each { |m, l| l.state = l.orig_new ? :open : :closed if m.is_a? Message }
     update
   end