]> git.cworth.org Git - sup/commitdiff
better reply from handling
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 14 Aug 2007 18:26:54 +0000 (18:26 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 14 Aug 2007 18:26:54 +0000 (18:26 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@527 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/reply-mode.rb

index 15ccd97241e742668d524c47285904425e472f76..63644b4b45dc5c58bc77d91ed2f8b09e57661277 100644 (file)
@@ -24,11 +24,13 @@ class ReplyMode < EditMessageMode
     body = reply_body_lines message
 
     from =
-      if @m.recipient_email
-        AccountManager.account_for @m.recipient_email
+      if @m.recipient_email && (a = AccountManager.account_for(@m.recipient_email))
+        a
+      elsif(b = (@m.to + @m.cc).find { |p| AccountManager.is_account? p })
+        b
       else
-        (@m.to + @m.cc).find { |p| AccountManager.is_account? p }
-      end || AccountManager.default_account
+        AccountManager.default_account
+      end
 
     ## ignore reply-to for list messages because it's typically set to
     ## the list address, which we explicitly treat with :list