From: lpsolit%gmail.com <> Date: Wed, 8 Aug 2007 06:53:37 +0000 (+0000) Subject: Bug 279318: Flag notifications are sent even if emails are turned off for the address... X-Git-Tag: bugzilla-3.0.1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f1823866a31ac04fbecae4d3cd5ce96397fb93c;p=thirdparty%2Fbugzilla.git Bug 279318: Flag notifications are sent even if emails are turned off for the addressee - Patch by Tiago R. Mello r/a=LpSolit --- diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 7473ea1f1a..19ecf7fa90 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -1047,9 +1047,13 @@ sub notify { # If there is nobody left to notify, return. return unless ($flag->{'addressee'} || $flag->type->cc_list); + my @recipients = split(/[, ]+/, $flag->type->cc_list); + # Only notify if the addressee is allowed to receive the email. + if ($flag->{'addressee'} && $flag->{'addressee'}->email_enabled) { + push @recipients, $flag->{'addressee'}->email; + } # Process and send notification for each recipient - foreach my $to ($flag->{'addressee'} ? $flag->{'addressee'}->email : '', - split(/[, ]+/, $flag->type->cc_list)) + foreach my $to (@recipients) { next unless $to; my $vars = { 'flag' => $flag,