summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugMail.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-04-08 22:03:09 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-04-08 22:03:09 +0200
commit72780239f1572950635e058caa4c28068034045f (patch)
treeee70cdd5d7f93a43d4aa638b6fb2d4b5ab42b003 /Bugzilla/BugMail.pm
parentbae339624bf43994d7cf3b543752c8ae0058d6b9 (diff)
downloadbugzilla-72780239f1572950635e058caa4c28068034045f.tar.gz
bugzilla-72780239f1572950635e058caa4c28068034045f.tar.xz
Bug 148564 - Ability to ignore specific bugs (not get email from them, even as the reporter)
r=glob,r/a=LpSolit
Diffstat (limited to 'Bugzilla/BugMail.pm')
-rw-r--r--Bugzilla/BugMail.pm14
1 files changed, 10 insertions, 4 deletions
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,