From: wmorgan Date: Mon, 29 Oct 2007 14:44:27 +0000 (+0000) Subject: in thread-view-mode, when editing labels, edit thread labels rather than individual... X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=47b63308254b5e70157a3c0ac63dcebf36f8c319;p=sup in thread-view-mode, when editing labels, edit thread labels rather than individual message labels git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@644 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/doc/TODO b/doc/TODO index f73afa1..df4e157 100644 --- a/doc/TODO +++ b/doc/TODO @@ -14,6 +14,10 @@ x hookability for 0.3 ------- +_ mark thread as unread should remember the unread messages and mark + only them as unread, just like gmail +_ mark thread as unread should have a version within thread-view-mode + which then also closes the buffer _ bugfix: time zone parsing broken? _ mailing list auto-subscribe/unsubscribe _ forwards optionally include attachments diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb index 9c53242..f00e19c 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -139,15 +139,12 @@ class ThreadViewMode < LineCursorMode end def edit_labels - m = @message_lines[curpos] or return - - reserved_labels = m.labels.select { |l| LabelManager::RESERVED_LABELS.include? l } - new_labels = BufferManager.ask_for_labels :label, "Labels for message: ", m.labels + reserved_labels = @thread.labels.select { |l| LabelManager::RESERVED_LABELS.include? l } + new_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", @thread.labels return unless new_labels - m.labels = (reserved_labels + new_labels).uniq + @thread.labels = (reserved_labels + new_labels).uniq new_labels.each { |l| LabelManager << l } - ## TODO: don't recalculate EVERYTHING update UpdateManager.relay self, :label, m end @@ -443,7 +440,7 @@ private rest += format_person_list " Bcc: ", m.bcc end - show_labels = m.labels - LabelManager::HIDDEN_RESERVED_LABELS + show_labels = @thread.labels - LabelManager::HIDDEN_RESERVED_LABELS rest += [ " Date: #{m.date.strftime DATE_FORMAT} (#{m.date.to_nice_distance_s})", " Subject: #{m.subj}",