-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,10 +88,6 @@ def initialize message, type_arg=nil | |
## next, cc: | ||
cc = (@m.to + @m.cc - [from, to]).uniq | ||
|
||
if to.full_address == "[email protected]" | ||
to = nil | ||
end | ||
|
||
## one potential reply type is "reply to recipient". this only happens | ||
## in certain cases: | ||
## if there's no cc, then the sender is the person you want to reply | ||
|
@@ -101,28 +97,30 @@ def initialize message, type_arg=nil | |
|
||
@headers = {} | ||
@headers[:recipient] = { | ||
"To" => (cc.map { |p| p.full_address == "[email protected]" ? nil : p.full_address}.compact), | ||
"To" => (cc.map { |p| p.email == "[email protected]" ? nil : p.email}.compact), | ||
"Cc" => [], | ||
} if useful_recipient | ||
|
||
## typically we don't want to have a reply-to-sender option if the sender | ||
## is a user account. however, if the cc is empty, it's a message to | ||
## ourselves, so for the lack of any other options, we'll add it. | ||
@headers[:sender] = { | ||
"To" => [to.full_address], | ||
"Cc" => [], | ||
} if !AccountManager.is_account?(to) && !useful_recipient && !to.full_address == "[email protected]" | ||
if !AccountManager.is_account?(to) || !useful_recipient | ||
@headers[:sender] = { | ||
"To" => [to.full_address], | ||
"Cc" => [], | ||
} unless to.email == "[email protected]" | ||
end | ||
|
||
@headers[:user] = { | ||
"To" => [], | ||
"Cc" => [], | ||
} | ||
|
||
not_me_ccs = cc.select { |p| !AccountManager.is_account?(p) } | ||
@headers[:all] = { | ||
"To" => [to.full_address], | ||
"Cc" => (not_me_ccs.map { |p| p.full_address == "[email protected]" ? nil : p.full_address }.compact), | ||
} if !not_me_ccs.empty? && !to.full_address == "[email protected]" | ||
"Cc" => (not_me_ccs.map { |p| p.email == "[email protected]" ? nil : p.email }.compact), | ||
} unless not_me_ccs.empty? or to.email == "[email protected]" | ||
|
||
@headers[:list] = { | ||
"To" => [@m.list_address.full_address], | ||
|