]> git.cworth.org Git - sup/commitdiff
reply to all now excludes your email address(es)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 17 Jun 2007 19:35:41 +0000 (19:35 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 17 Jun 2007 19:35:41 +0000 (19:35 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@461 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/reply-mode.rb

index e29bf574d9a0b88c36a1716e394fa1da28566c36..779bd860a2faba97a44f5d17d9340988935cf9ec 100644 (file)
@@ -26,16 +26,15 @@ class ReplyMode < EditMessageMode
 
     from =
       if @m.recipient_email
-        AccountManager.account_for(@m.recipient_email)
+        AccountManager.account_for @m.recipient_email
       else
         (@m.to + @m.cc).find { |p| AccountManager.is_account? p }
       end || AccountManager.default_account
 
-    #from_email = @m.recipient_email || from.email
     from_email = from.email
 
     ## ignore reply-to for list messages because it's typically set to
-    ## the list address anyways
+    ## the list address, which we explicitly treat with :list
     to = @m.is_list_message? ? @m.from : (@m.replyto || @m.from)
     cc = (@m.to + @m.cc - [from, to]).uniq
 
@@ -57,7 +56,7 @@ class ReplyMode < EditMessageMode
     @headers[:all] = {
       "From" => "#{from.name} <#{from_email}>",
       "To" => [to.full_address],
-      "Cc" => cc.map { |p| p.full_address },
+      "Cc" => cc.select { |p| !AccountManager.is_account?(p) }.map { |p| p.full_address },
     } unless cc.empty?
 
     @headers[:list] = {