sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 66d13726f817ac87870254af8239e0375c7817eb
parent c59880eac5b988b139e0018583f2d47a4a4272f5
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Wed, 14 Nov 2007 16:46:37 +0000

added before-edit hook from Pierre Baillet

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@702 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/modes/edit-message-mode.rb | 12 ++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
@@ -24,6 +24,16 @@ Return value:
   use the default signature.
 EOS
 
+  HookManager.register "before-edit", <<EOS
+Modifies message body and headers before editing a new message. Variables
+should be modified in place.
+Variables:
+	header: a hash of headers. See 'signature' hook for documentation.
+	body: an array of lines of body text.
+Return value:
+	none
+EOS
+
   attr_reader :status
   attr_accessor :body, :header
   bool_reader :edited
@@ -51,6 +61,8 @@ EOS
     @message_id = "<#{Time.now.to_i}-sup-#{rand 10000}@#{Socket.gethostname}>"
     @edited = false
     @skip_top_rows = opts[:skip_top_rows] || 0
+    
+    HookManager.run "before-edit", :header => @header, :body => @body
 
     super opts
     regen_text