]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Add a "bug" argument to the bugmail_recipients hook that was just checked in.
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 11 Feb 2010 19:12:43 +0000 (11:12 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 11 Feb 2010 19:12:43 +0000 (11:12 -0800)
r=mkanat, a=mkanat (module owner)

https://bugzilla.mozilla.org/show_bug.cgi?id=545683

Bugzilla/BugMail.pm
Bugzilla/Hook.pm
extensions/Example/Extension.pm

index 7a92b13a540a37c9b0b7fccf6357ea0e4aaa7f38..b718f4199daaa2bd2283fbea7ce3247e730f5f86 100644 (file)
@@ -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.
index 36f08397565a6f806fe030eff3bdd2a007dc08e6..cf718c94f38d5e740cd134a236410c568135ab04 100644 (file)
@@ -374,6 +374,10 @@ Params:
 
 =over
 
+=item C<bug>
+
+The L<Bugzilla::Bug> that bugmail is being sent about.
+
 =item C<recipients>
 
 This is a hashref. The keys are numeric user ids from the C<profiles>
index 77489692cfbfa89ff1785b0d8bb6ea67ff125400..fd75cbf6454b18df8cd330416e97b7351ac74db4 100644 (file)
@@ -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 {