commit a13a0d4e6985f224af286039f5c0eaddbad38035
parent 1db62f16e10bfa2bac87f33137cae4c1484d5e52
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date: Thu, 15 Mar 2007 20:34:29 +0000
bugfix for expand new messages
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@349 5c8cc53c-5e98-4d25-b20a-d8db53a31250
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
@@ -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