Commit 4c0d90b0 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 349852: "I'm added to or removed from this capacity" email pref doesn't work…

Bug 349852: "I'm added to or removed from this capacity" email pref doesn't work for new bugs - Original patch by Olav Vitters <bugzilla-mozilla@bkor.dhs.org>, slightly modified by Frédéric Buclin <LpSolit@gmail.com> r=LpSolit, r=mkanat a=justdave
parent 6c0f16ff
...@@ -418,7 +418,8 @@ sub ProcessOneBug { ...@@ -418,7 +418,8 @@ sub ProcessOneBug {
$relationship, $relationship,
$diffs, $diffs,
$newcomments, $newcomments,
$changer)) $changer,
!$start))
{ {
$rels_which_want{$relationship} = $rels_which_want{$relationship} =
$recipients{$user_id}->{$relationship}; $recipients{$user_id}->{$relationship};
......
...@@ -1183,7 +1183,7 @@ our %names_to_events = ( ...@@ -1183,7 +1183,7 @@ our %names_to_events = (
# Note: the "+" signs before the constants suppress bareword quoting. # Note: the "+" signs before the constants suppress bareword quoting.
sub wants_bug_mail { sub wants_bug_mail {
my $self = shift; my $self = shift;
my ($bug_id, $relationship, $fieldDiffs, $commentField, $changer) = @_; my ($bug_id, $relationship, $fieldDiffs, $commentField, $changer, $bug_is_new) = @_;
# Don't send any mail, ever, if account is disabled # Don't send any mail, ever, if account is disabled
# XXX Temporary Compatibility Change 1 of 2: # XXX Temporary Compatibility Change 1 of 2:
...@@ -1228,6 +1228,16 @@ sub wants_bug_mail { ...@@ -1228,6 +1228,16 @@ sub wants_bug_mail {
} }
} }
# You role is new if the bug itself is.
# Only makes sense for the assignee, QA contact and the CC list.
if ($bug_is_new
&& ($relationship == REL_ASSIGNEE
|| $relationship == REL_QA
|| $relationship == REL_CC))
{
$events{+EVT_ADDED_REMOVED} = 1;
}
if ($commentField =~ /Created an attachment \(/) { if ($commentField =~ /Created an attachment \(/) {
$events{+EVT_ATTACHMENT} = 1; $events{+EVT_ATTACHMENT} = 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment