sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 1db62f16e10bfa2bac87f33137cae4c1484d5e52
parent 8b19cba007a7cec592140fd0cdabc72a2ad0121c
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Mon, 12 Mar 2007 01:30:38 +0000

bugfix: mark thread as read immediately upon view

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@348 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M doc/TODO | 6 +++---
M lib/sup/modes/thread-index-mode.rb | 8 ++++----
M lib/sup/modes/thread-view-mode.rb | 4 +---
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/doc/TODO b/doc/TODO
@@ -1,9 +1,9 @@
 for 0.0.8
 ---------
 x maildir
-_ bugfix: single-line messages come empty upon reply
+x bugfix: single-line messages come empty upon reply
 _ bugfix: when one new message comes into an imap folder, we don't
-   catch it until a restart
+   catch it until a reload
 _ bugfix: triggering a pageup when cursor scrolling up jumps to the
    bottom of the page rather than the next line
 _ create attachments
@@ -11,7 +11,7 @@ _ forward attachments
 _ warnings: top-posting, missing attachment
 x compose in thread-view-mode auto-fills in person
 _ bugfix: stars on messages with blue backgrounds still have green bgs
-_ bugfix: mark messages as read immediately when t-v-m is opened
+x bugfix: mark messages as read immediately when t-v-m is opened
 
 for 0.0.9
 ---------
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -58,10 +58,6 @@ class ThreadIndexMode < LineCursorMode
   def select t=nil
     t ||= @threads[curpos]
 
-    ## this isn't working entirely. TODO:figure out why
-    # t = t.clone # required so that messages added later on don't completely
-                # screw everything up
-
     ## TODO: don't regen text completely
     Redwood::reporting_thread do
       BufferManager.say("Loading message bodies...") do |sid|
@@ -74,6 +70,10 @@ class ThreadIndexMode < LineCursorMode
       BufferManager.draw_screen # lame TODO: make this unnecessary
       ## 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
+      update_text_for_line curpos
+      UpdateManager.relay self, :read, t
     end
   end
 
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
@@ -254,9 +254,7 @@ class ThreadViewMode < LineCursorMode
   end
 
   def cleanup
-    @thread.remove_label :unread
-    UpdateManager.relay self, :read, @thread
-    @layout = @text = nil
+    @layout = @text = nil # for good luck
   end
 
   def archive_and_kill