From: Max Kanat-Alexander Date: Thu, 11 Feb 2010 19:12:43 +0000 (-0800) Subject: Add a "bug" argument to the bugmail_recipients hook that was just checked in. X-Git-Tag: bugzilla-3.7.1~260 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5721ab05a01ea3dacfc6f07669469b3868a4df06;p=thirdparty%2Fbugzilla.git Add a "bug" argument to the bugmail_recipients hook that was just checked in. r=mkanat, a=mkanat (module owner) https://bugzilla.mozilla.org/show_bug.cgi?id=545683 --- diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 7a92b13a54..b718f4199d 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -428,7 +428,7 @@ sub Send { } Bugzilla::Hook::process('bugmail_recipients', - { recipients => \%recipients }); + { bug => $bug, recipients => \%recipients }); # Find all those user-watching anyone on the current list, who is not # on it already themselves. diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index 36f0839756..cf718c94f3 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -374,6 +374,10 @@ Params: =over +=item C + +The L that bugmail is being sent about. + =item C This is a hashref. The keys are numeric user ids from the C diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index 77489692cf..fd75cbf645 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -191,10 +191,14 @@ sub buglist_columns { sub bugmail_recipients { my ($self, $args) = @_; - my $recipients = $args->{'recipients'}; - # Uncomment the below line to add the first user in the Bugzilla database - # to every bugmail as though he/she were a CC. - #$recipients->{1}->{+REL_CC} = 1; + my $recipients = $args->{recipients}; + my $bug = $args->{bug}; + if ($bug->id == 1) { + # Uncomment the line below to add the second user in the Bugzilla + # database to the recipients list of every bugmail sent out about + # bug 1 as though that user were on the CC list. + #$recipients->{2}->{+REL_CC} = 1; + } } sub colchange_columns {