sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 3ed33c9219fd9fb6d2972e941890a516b5a68e8d
parent 8afdb020c0e44d7625d32c9c6f0e2d44a7ceea49
Author: Hamish Downer <dmishd@gmail.com>
Date:   Tue, 16 Nov 2010 22:54:06 +0000

added signature output hook

Diffstat:
M lib/sup/crypto.rb | 15 +++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
@@ -28,6 +28,17 @@ options: a dictionary of values to be passed to GPGME
 Return value: a dictionary to be passed to GPGME
 EOS
 
+  HookManager.register "sig-output", <<EOS
+Runs when the signature output is being generated, allowing you to
+add extra information to your signatures if you want.
+  
+Variables:
+signature: the signature object (class is GPGME::Signature)
+from_key: the key that generated the signature (class is GPGME::Key)
+
+Return value: an array of lines of output
+EOS
+
   def initialize
     @mutex = Mutex.new
 
@@ -274,6 +285,10 @@ private
         output_lines << "WARNING: This key is not certified with a trusted signature!"
         output_lines << "There is no indication that the signature belongs to the owner"
       end
+
+      # finally, run the hook
+      output_lines << HookManager.run("sig-output",
+                               {:signature => signature, :from_key => from_key})
     end
     output_lines
   end