Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
From: Damien Leone <damien.leone@fensalir.fr>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [sup-devel] [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed
Date: Sun, 27 Feb 2011 18:09:43 +0100	[thread overview]
Message-ID: <1298826320-sup-8596@mailer> (raw)


[-- 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

             reply	other threads:[~2011-02-27 17:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-27 17:09 Damien Leone [this message]
2011-03-07 21:22 ` Damien Leone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298826320-sup-8596@mailer \
    --to=damien.leone@fensalir.fr \
    --cc=sup-devel@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox