Remove and add back recipients (#298)

This commit is contained in:
Shawn Iverson 2018-11-15 07:53:50 -05:00 committed by GitHub
parent d80fa6490d
commit 840eb57b76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -832,16 +832,43 @@ sub new {
return 0;
}
# Unused in MSMail
# Delete the original recipients from the message. We'll add some
# using AddRecipients later.
sub DeleteRecipients {
return;
my $this = shift;
my($message) = @_;
my($linenum);
for ($linenum=0; $linenum<@{$message->{metadata}}; $linenum++) {
next unless $message->{metadata}[$linenum] =~ /^O/;
# Have found the right line
splice(@{$message->{metadata}}, $linenum, 1);
$linenum--; # Study the same line again
}
}
# Unused in MSMail
# Add the recipient records back to the metadata
sub AddRecipients {
return;
my $this = shift;
my($message, @recips) = @_;
# Remove all the duplicates @recips
my %uniqueto;
foreach (@recips) {
$uniqueto{$_} = 1;
}
@recips = keys %uniqueto;
#my $totallines = @{$message->{metadata}};
foreach (@recips) {
s/^/O/;
}
splice @{$message->{metadata}}, 0, 0, @recips;
}
sub KickMessage {
my($queue2ids, $sendmail2) = @_;
my($queue);