From 72780239f1572950635e058caa4c28068034045f Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Mon, 8 Apr 2013 16:03:09 -0400 Subject: Bug 148564 - Ability to ignore specific bugs (not get email from them, even as the reporter) r=glob,r/a=LpSolit --- Bugzilla/BugMail.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Bugzilla/BugMail.pm') diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 089d3013e..12914ca73 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -212,6 +212,13 @@ sub Send { # Deleted users must be excluded. next unless $user; + # If email notifications are disabled for this account, or the bug + # is ignored, there is no need to do additional checks. + if ($user->email_disabled || $user->is_bug_ignored($id)) { + push(@excluded, $user->login); + next; + } + if ($user->can_see_bug($id)) { # Go through each role the user has and see if they want mail in # that role. @@ -228,7 +235,7 @@ sub Send { } } } - + if (scalar(%rels_which_want)) { # So the user exists, can see the bug, and wants mail in at least # one role. But do we want to send it to them? @@ -241,9 +248,8 @@ sub Send { $dep_ok = $user->can_see_bug($params->{blocker}->id) ? 1 : 0; } - # Make sure the user isn't in the nomail list, and the dep check passed. - if ($user->email_enabled && $dep_ok) { - # OK, OK, if we must. Email the user. + # Email the user if the dep check passed. + if ($dep_ok) { $sent_mail = sendMail( { to => $user, bug => $bug, -- cgit v1.2.3-24-g4f1b