]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 303824: BugMail should ignore deleted or renamed user accounts - Patch by Frédéri...
authorlpsolit%gmail.com <>
Sat, 13 Aug 2005 21:07:43 +0000 (21:07 +0000)
committerlpsolit%gmail.com <>
Sat, 13 Aug 2005 21:07:43 +0000 (21:07 +0000)
Bugzilla/BugMail.pm

index faa30b09029d79dd3facd4dc4179d28512cb48cc..b6c5badfad0630868de79f87d7810bbaeb4e47df 100644 (file)
@@ -39,6 +39,7 @@ use base qw(Exporter);
 use Bugzilla::Constants;
 use Bugzilla::Config qw(:DEFAULT $datadir);
 use Bugzilla::Util;
+use Bugzilla::User;
 
 use Mail::Mailer;
 use Mail::Header;
@@ -362,16 +363,20 @@ sub ProcessOneBug($$) {
         if ($old) {
             # You can't stop being the reporter, and mail isn't sent if you
             # remove your vote.
+            # Ignore people whose user account has been deleted or renamed.
             if ($what eq "CC") {
                 foreach my $cc_user (split(/[\s,]+/, $old)) {
-                    push(@{$recipients{DBNameToIdAndCheck($cc_user)}}, REL_CC);
+                    my $uid = login_to_id($cc_user);
+                    push(@{$recipients{$uid}}, REL_CC) if $uid;
                 }
             }
             elsif ($what eq "QAContact") {
-                push(@{$recipients{DBNameToIdAndCheck($old)}}, REL_QA);
+                my $uid = login_to_id($old);
+                push(@{$recipients{$uid}}, REL_QA) if $uid;
             }
             elsif ($what eq "AssignedTo") {
-                push(@{$recipients{DBNameToIdAndCheck($old)}}, REL_ASSIGNEE);
+                my $uid = login_to_id($old);
+                push(@{$recipients{$uid}}, REL_ASSIGNEE) if $uid;
             }
         }
     }