From: Mark Alexander <marka@pobox.com>
To: Mark Alexander <marka@pobox.com>
Cc: sup-talk <sup-talk@rubyforge.org>,
Sup developer discussion <sup-devel@rubyforge.org>
Subject: Re: [sup-devel] [sup-talk] Preparing for sup 0.13
Date: Thu, 20 Oct 2011 09:18:01 -0400 [thread overview]
Message-ID: <1319116525-sup-839@bloovis.org> (raw)
In-Reply-To: <1319034152-sup-5416@bloovis.org>
[-- Attachment #1: Type: text/plain, Size: 808 bytes --]
Excerpts from Mark Alexander's message of Wed Oct 19 10:31:29 -0400 2011:
> Excerpts from Hamish D's message of Sun Oct 16 08:09:41 -0400 2011:
> > * added an account selector when composing email for those who have
> > multiple possible from addresses
>
> I'm having a problem with this feature, too.
>
> I have two main email accounts, one for personal email and one for
> work email. My before-edit.rb hook figures out which account to use
> as the sender (the "From" header) by looking at the recipients (the
> "To" header). This worked with sup 0.12, but with 0.13 the sender is
> changed back to the default as soon as I exit the editor.
I'm trying out the attached fix, and so far it seems to work.
it simply moves the calling of the before-edit hook before
the creation of the account selector.
[-- Attachment #2: before-edit.patch --]
[-- Type: application/octet-stream, Size: 877 bytes --]
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index 5947ffd..e60009f 100644
--- 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
+
# only show account selector if there is more than one email address
if $config[:account_selector] && AccountManager.user_emails.length > 1
## Duplicate e-mail strings to prevent a "can't modify frozen
@@ -144,7 +146,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
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
prev parent reply other threads:[~2011-10-20 13:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-16 12:09 Hamish D
2011-10-18 13:46 ` [sup-devel] " Mark Alexander
2011-10-18 17:58 ` Hamish D
2011-10-19 14:31 ` [sup-devel] " Mark Alexander
2011-10-20 13:18 ` Mark Alexander [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1319116525-sup-839@bloovis.org \
--to=marka@pobox.com \
--cc=sup-devel@rubyforge.org \
--cc=sup-talk@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox