sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit cabfa0a57a624a298fe736f61c031658872e9b8f
parent 1bf2c1c01aa885f49ef2e9886f8c1af9c5aaf309
Author: Mark Alexander <marka@pobox.com>
Date:   Sat, 13 Apr 2013 10:17:20 -0400

Fix problem with account selector

When sending a message, the account selector was ignoring
the account set by the before-edit hook.  Fix this
by running the hook before setting up the account selector.

Diffstat:
M lib/sup/modes/edit-message-mode.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
@@ -116,6 +116,8 @@ EOS
     @selector_label_width = 0
     @async_mode = nil
 
+    HookManager.run "before-edit", :header => @header, :body => @body
+
     @account_selector = nil
     # only show account selector if there is more than one email address
     if $config[:account_selector] && AccountManager.user_emails.length > 1
@@ -145,7 +147,6 @@ EOS
       end
     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