summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-08-08 08:52:22 +0200
committerlpsolit%gmail.com <>2007-08-08 08:52:22 +0200
commita33a5f6ed8bf4f8c20ccad3d4cc379059cdc2fbd (patch)
tree4c74e499d322d25c28af66b724a37ab507293c92
parent4d1b66af361378015042bc3d73d83c12de58621d (diff)
downloadbugzilla-a33a5f6ed8bf4f8c20ccad3d4cc379059cdc2fbd.tar.gz
bugzilla-a33a5f6ed8bf4f8c20ccad3d4cc379059cdc2fbd.tar.xz
Bug 279318: Flag notifications are sent even if emails are turned off for the addressee - Patch by Tiago R. Mello <timello@gmail.com> r/a=LpSolit
-rw-r--r--Bugzilla/Flag.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 7473ea1f1..19ecf7fa9 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,