commit 22fcff8b1e668987d32bc044f7b94b5251a8ef7c
parent d095234d7a682a8cb63debae87b327912ba1cf59
Author: Damien Leone <damien.leone@fensalir.fr>
Date: Sat, 12 Jun 2010 11:21:39 +0200
Mark thread as read after ThreadViewMode has been instancied
This patch delays the moment when the ":unread" label is removed so when
opening a thread you know exactly what are the new messages thanks to
the 'N' flag.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -124,6 +124,9 @@ EOS
## the first draw_screen is needed before topline and botline
## are set, and the second to show the cursor having moved
+ t.remove_label :unread
+ Index.save_thread t
+
update_text_for_line curpos
UpdateManager.relay self, :read, t.first
when_done.call if when_done
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
@@ -146,9 +146,6 @@ EOS
@layout[latest].state = :open if @layout[latest].state == :closed
@layout[earliest].state = :detailed if earliest.has_label?(:unread) || @thread.size == 1
-
- @thread.remove_label :unread
- Index.save_thread @thread
end
def toggle_wrap