]> git.cworth.org Git - sup/commitdiff
final (?) 0.0.7 updates
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 12 Feb 2007 22:56:52 +0000 (22:56 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 12 Feb 2007 22:56:52 +0000 (22:56 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@323 5c8cc53c-5e98-4d25-b20a-d8db53a31250

History.txt
doc/TODO
lib/sup.rb
lib/sup/modes/inbox-mode.rb
lib/sup/modes/thread-index-mode.rb
lib/sup/thread.rb

index 8a24ca2567cf4ca268dd959c131b0e79911adfac..ac5e1ba2c0b8543aa2fe1d8631708501fe5dd23f 100644 (file)
@@ -1,9 +1,10 @@
-== 0.0.7 / XXXXXX
-* Moving messages between sources now preserves state.
+== 0.0.7 / 2007-02-12
 * Split sup-import into two bits: sup-import and sup-add.
 * Command-line arguments now handled by trollop.
 * Better error handling for IMAP and svn+ssh.
-* New commands in thread-view-mode
+* Messages can now be moved between sources while preserving all
+  message state.
+* New commands in thread-view-mode:
   - 'a' to add an email to the addressbook
   - 'S' to search for all email to/from an email address
   - 'A' to kill buffer and archive thread in one swell foop
index d840734b6564b9aee0f8e2a58855e9dcb0faf5f5..bf2b11feac2541576e8e23134b4626bfeca5d30e 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,7 +1,3 @@
-for 0.0.7
-----------------
-de-archived messages should be auto-added to inbox
-
 for 0.0.8
 ---------
 message attachments
@@ -34,6 +30,7 @@ annotations on messages
 pop
 be able to mark individual messages as spam in thread-view-mode
 toggle wrapping
+maybe: de-archived messages auto-added to inbox
 
 done
 ----
index dc528ff4ec39e08f6cc51b456b1880277b6d6afd..2df5e524c8b226724e1c0ee25d007ca77c71c3f2 100644 (file)
@@ -13,7 +13,7 @@ class Object
 end
 
 module Redwood
-  VERSION = "0.0.6"
+  VERSION = "0.0.7"
 
   BASE_DIR   = ENV["SUP_BASE"] || File.join(ENV["HOME"], ".sup")
   CONFIG_FN  = File.join(BASE_DIR, "config.yaml")
index b33a4843b8f19849d10b6989904a886939d0c72b..780ae4c72a5b8e1c9ec906413fc7ddf512674a0a 100644 (file)
@@ -29,9 +29,11 @@ class InboxMode < ThreadIndexMode
     hide_thread t if contains_thread? t
   end
 
-  def handle_unarchived_update sender, t
-    ## XXX todo: fill me in
-  end
+# not quite working, and not sure if i like it anyways
+#   def handle_unarchived_update sender, t
+#     Redwood::log "unarchived #{t.subj}"
+#     show_thread t
+#   end
 
   def status
     super + "    #{Index.size} messages in index"
index de799000b9d1975d500166e3e8e799cb6db49534..d67a076724a1c49f73909c6c5803d99f4b9cd0f9 100644 (file)
@@ -82,18 +82,19 @@ class ThreadIndexMode < LineCursorMode
   end
   
   def handle_starred_update sender, m
-    return unless(t = @ts.thread_for m)
-    update_text_for_line @lines[t]
+    t = @ts.thread_for(m) or return
+    l = @lines[t] or return
+    update_text_for_line l
     BufferManager.draw_screen
   end
 
   def handle_read_update sender, t
-    return unless @lines[t]
+    l = @lines[t] or return
     update_text_for_line @lines[t]
     BufferManager.draw_screen
   end
 
-  def handle_archived_update *a; handle_read_update *a; end
+  def handle_archived_update *a; handle_read_update(*a); end
 
   ## overwrite me!
   def is_relevant? m; false; end
@@ -155,10 +156,10 @@ class ThreadIndexMode < LineCursorMode
   def actually_toggle_archived t
     if t.has_label? :inbox
       t.remove_label :inbox
-      UpdateManager.relay self, :unarchived, t
-    else
-      t.add_label :inbox
       UpdateManager.relay self, :archived, t
+    else
+      t.apply_label :inbox
+      UpdateManager.relay self, :unarchived, t
     end
   end
 
@@ -383,6 +384,15 @@ protected
     @tags.drop_tag_for t
   end
 
+  def show_thread t
+    if @hidden_threads[t]
+      @hidden_threads.delete t
+    else
+      @ts.add_thread t
+    end
+    update
+  end
+
   def update_text_for_line l
     return unless l # not sure why this happens, but it does, occasionally
     @text[l] = text_for_thread @threads[l]
index 92129e895c1d9375d5d8f108cee371096392f4e4..3d94567996e840b5fe613be0df2f484df78fab19 100644 (file)
@@ -303,6 +303,12 @@ class ThreadSet
     end
   end
 
+  ## merges in a pre-loaded thread
+  def add_thread t
+    raise "duplicate" if @subj_thread.values.member? t
+    t.each { |m, *o| add_message m }
+  end
+
   def is_relevant? m
     m.refs.any? { |ref_id| @messages[ref_id] }
   end