sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 07c169d6683a625e0258472603894609601ab98c
parent 6c50fa234d179a5f116c75c8f9fbbb41e08a1195
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Sat, 27 Feb 2010 00:37:46 -0800

Merge branch 'master' into next

Diffstat:
M lib/sup/crypto.rb | 12 ++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
@@ -11,6 +11,17 @@ class CryptoManager
     [:encrypt, "Encrypt only"]
   )
 
+  HookManager.register "gpg-args", <<EOS
+Runs before gpg is executed, allowing you to modify the arguments (most
+likely you would want to add something to certain commands, like
+--trust-model always to signing/encrypting a message, but who knows).
+
+Variables:
+args: arguments for running GPG
+
+Return value: the arguments for running GPG
+EOS
+
   def initialize
     @mutex = Mutex.new
 
@@ -182,6 +193,7 @@ private
   end
 
   def run_gpg args, opts={}
+    args = HookManager.run("gpg-args", { :args => args }) || args
     cmd = "#{@cmd} #{args}"
     if opts[:interactive] && BufferManager.instantiated?
       output_fn = Tempfile.new "redwood.output"