From 8e0c182dad332960ebf53b87fb402ea1e049d779 Mon Sep 17 00:00:00 2001 From: wmorgan Date: Thu, 27 Sep 2007 00:18:12 +0000 Subject: [PATCH] fix crypto message expand/collapse behavior git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@597 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup/crypto.rb | 2 +- lib/sup/modes/thread-view-mode.rb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb index 5aca1a4..69b9408 100644 --- a/lib/sup/crypto.rb +++ b/lib/sup/crypto.rb @@ -132,6 +132,6 @@ end ## to check: ## failed decryption -## decription but failed signature +## decryption but failed signature ## no gpg found ## multiple private keys diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb index f0e8e63..f2ad547 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -172,6 +172,10 @@ class ThreadViewMode < LineCursorMode UpdateManager.relay self, :label, m end + ## a little overly complicated. for quotes and signatures, if it's + ## one line, we just display it and don't allow for + ## collapsing/expanding. for crypto notices, we allow + ## expanding/collapsing iff the # of notice lines is > 0. def toggle_expanded chunk = @chunk_lines[curpos] or return case chunk @@ -179,7 +183,10 @@ class ThreadViewMode < LineCursorMode l = @layout[chunk] l.state = (l.state != :closed ? :closed : :open) cursor_down if l.state == :closed - when Message::Quote, Message::Signature, CryptoSignature, CryptoDecryptedNotice + when CryptoSignature, CryptoDecryptedNotice + return if chunk.lines.empty? + toggle_chunk_expansion chunk + when Message::Quote, Message::Signature return if chunk.lines.length <= 1 toggle_chunk_expansion chunk when Message::Attachment -- 2.45.2