]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 279318: Flag notifications are sent even if emails are turned off for the address...
authorlpsolit%gmail.com <>
Wed, 8 Aug 2007 06:53:37 +0000 (06:53 +0000)
committerlpsolit%gmail.com <>
Wed, 8 Aug 2007 06:53:37 +0000 (06:53 +0000)
Bugzilla/Flag.pm

index 7473ea1f1a80f68342de64691feb76dbbce72c96..19ecf7fa904b93d13502d975d56914ada6c5906c 100644 (file)
@@ -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,