Nicolas Pouillard
2008-Apr-04 16:01 UTC
[sup-talk] [PATCH] Fix a bug when forwarding and using crypto.
---
lib/sup/modes/edit-message-mode.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/sup/modes/edit-message-mode.rb
b/lib/sup/modes/edit-message-mode.rb
index 3aad623..dd96002 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -324,7 +324,7 @@ protected
## do whatever crypto transformation is necessary
if @crypto_selector && @crypto_selector.val != :none
from_email = PersonManager.person_for(@header["From"]).email
- to_email = (@header["To"] + @header["Cc"] +
@header["Bcc"]).map { |p| PersonManager.person_for(p).email }
+ to_email = [@header["To"], @header["Cc"],
@header["Bcc"]].flatten.compact.map { |p|
PersonManager.person_for(p).email }
m = CryptoManager.send @crypto_selector.val, from_email, to_email, m
end
--
1.5.5.rc3
William Morgan
2008-Apr-04 17:44 UTC
[sup-talk] [PATCH] Fix a bug when forwarding and using crypto.
Reformatted excerpts from nicolas.pouillard''s message of 2008-04-04:> - to_email = (@header["To"] + @header["Cc"] + @header["Bcc"]).map { |p| PersonManager.person_for(p).email } > + to_email = [@header["To"], @header["Cc"], @header["Bcc"]].flatten.compact.map { |p| PersonManager.person_for(p).email }What was the bug? -- William <wmorgan-sup at masanjin.net>
Nicolas Pouillard
2008-Apr-05 10:39 UTC
[sup-talk] [PATCH] Fix a bug when forwarding and using crypto.
Excerpts from William Morgan''s message of Fri Apr 04 19:44:53 +0200 2008:> Reformatted excerpts from nicolas.pouillard''s message of 2008-04-04: > > - to_email = (@header["To"] + @header["Cc"] + @header["Bcc"]).map { |p| PersonManager.person_for(p).email } > > + to_email = [@header["To"], @header["Cc"], @header["Bcc"]].flatten.compact.map { |p| PersonManager.person_for(p).email } > > What was the bug?When some of these @header[...] are not present I get a nil and then get an error when using ''+'' on them. -- Nicolas Pouillard aka Ertai -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 194 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080405/863f13ca/attachment.bin
Nicolas Pouillard
2008-Apr-23 09:04 UTC
[sup-talk] [PATCH] Fix a bug when forwarding and using crypto.
What about this patch? Excerpts from Nicolas Pouillard''s message of Fri Apr 04 18:01:45 +0200 2008:> --- > lib/sup/modes/edit-message-mode.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb > index 3aad623..dd96002 100644 > --- a/lib/sup/modes/edit-message-mode.rb > +++ b/lib/sup/modes/edit-message-mode.rb > @@ -324,7 +324,7 @@ protected > ## do whatever crypto transformation is necessary > if @crypto_selector && @crypto_selector.val != :none > from_email = PersonManager.person_for(@header["From"]).email > - to_email = (@header["To"] + @header["Cc"] + @header["Bcc"]).map { |p| PersonManager.person_for(p).email } > + to_email = [@header["To"], @header["Cc"], @header["Bcc"]].flatten.compact.map { |p| PersonManager.person_for(p).email } > > m = CryptoManager.send @crypto_selector.val, from_email, to_email, m > end-- Nicolas Pouillard aka Ertai -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 194 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080423/01052d0f/attachment.bin