Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed
@ 2011-02-27 17:09 Damien Leone
  2011-03-07 21:22 ` Damien Leone
  0 siblings, 1 reply; 2+ messages in thread
From: Damien Leone @ 2011-02-27 17:09 UTC (permalink / raw)
  To: sup-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 643 bytes --]

Sup guys,

The current behavior is that when opening an unread thread, the unread
label is removed at the instanciation of the ThreadViewMode, thus it
makes the 'N' indicator useless.

Even if new messages are automatically expanded it can be confusing
when you open some old message in the same thread, at the end you
might not remember which ones are new.

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
that 'N' indicator.

Cheers,

-- 
Damien Leone <damien.leone@fensalir.fr>

Web: http://dleone.fensalir.fr/
GPG: 0x82EB4DDF

[-- Attachment #1.1.2: 0001-Mark-the-thread-as-read-after-the-ThreadViewMode-has.patch --]
[-- Type: application/octet-stream, Size: 1432 bytes --]

From a0e7f31ea57c9e452052bc05dfab0425d9334b2c Mon Sep 17 00:00:00 2001
From: Damien Leone <damien.leone@fensalir.fr>
Date: Sat, 12 Jun 2010 11:21:39 +0200
Subject: [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed

---
 lib/sup/modes/thread-index-mode.rb |    3 +++
 lib/sup/modes/thread-view-mode.rb  |    3 ---
 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
index e04e873..89bd218 100644
--- 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
index 955d71f..ac80143 100644
--- 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
-- 
1.7.2.3


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sup-devel] [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed
  2011-02-27 17:09 [sup-devel] [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed Damien Leone
@ 2011-03-07 21:22 ` Damien Leone
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Leone @ 2011-03-07 21:22 UTC (permalink / raw)
  To: sup-devel

Pushed.

-- 
Damien Leone <damien.leone@fensalir.fr>

Web: http://dleone.fensalir.fr/
GPG: 0x82EB4DDF
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-07 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-27 17:09 [sup-devel] [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed Damien Leone
2011-03-07 21:22 ` Damien Leone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox