sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 8c802fa3dbe32ce52d977655198cbbce04c938d6
parent 48446a38dfd6a164648ce94844b986d7d061c4a5
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Sat, 27 Feb 2010 10:17:11 -0800

Merge branch 'master' into next

Conflicts:
	lib/sup/modes/edit-message-mode.rb

Diffstat:
M lib/sup/modes/edit-message-mode.rb | 15 +++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
@@ -50,6 +50,18 @@ Return value:
 	True if attachments are mentioned.
 EOS
 
+  HookManager.register "crypto-mode", <<EOS
+Modifies cryptography settings based on header and message content, before
+editing a new message. This can be used to set, for example, default cryptography
+settings.
+Variables:
+    header: a hash of headers. See 'signature' hook for documentation.
+    body: an array of lines of body text.
+    crypto_selector: the UI element that controls the current cryptography setting.
+Return value:
+     none
+EOS
+
   attr_reader :status
   attr_accessor :body, :header
   bool_reader :edited
@@ -102,6 +114,9 @@ EOS
     add_selector @crypto_selector if @crypto_selector
     
     HookManager.run "before-edit", :header => @header, :body => @body
+    if @crypto_selector
+      HookManager.run "crypto-mode", :header => @header, :body => @body, :crypto_selector => @crypto_selector
+    end
 
     super opts
     regen_text