From: wmorgan Date: Mon, 12 Feb 2007 22:56:52 +0000 (+0000) Subject: final (?) 0.0.7 updates X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=9cc5af0aeecef802cbbbc078692163b8bf0dbe4b;p=sup final (?) 0.0.7 updates git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@323 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/History.txt b/History.txt index 8a24ca2..ac5e1ba 100644 --- a/History.txt +++ b/History.txt @@ -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 diff --git a/doc/TODO b/doc/TODO index d840734..bf2b11f 100644 --- 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 ---- diff --git a/lib/sup.rb b/lib/sup.rb index dc528ff..2df5e52 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -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") diff --git a/lib/sup/modes/inbox-mode.rb b/lib/sup/modes/inbox-mode.rb index b33a484..780ae4c 100644 --- a/lib/sup/modes/inbox-mode.rb +++ b/lib/sup/modes/inbox-mode.rb @@ -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" diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index de79900..d67a076 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -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] diff --git a/lib/sup/thread.rb b/lib/sup/thread.rb index 92129e8..3d94567 100644 --- a/lib/sup/thread.rb +++ b/lib/sup/thread.rb @@ -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