]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Provide user objects to bugmail_recipients hook. r,a=mkanat.
authorGervase Markham <gerv@gerv.net>
Fri, 7 Jan 2011 11:00:25 +0000 (11:00 +0000)
committerGervase Markham <gerv@mozilla.org>
Fri, 7 Jan 2011 11:00:25 +0000 (11:00 +0000)
https://bugzilla.mozilla.org/show_bug.cgi?id=622813

Bugzilla/BugMail.pm
Bugzilla/Hook.pm

index dfd7584ea63e4265720e1e4f6a0ea0cc61a06bd5..048488e02ee1fe02428c1a4e962ad80db5a59568 100644 (file)
@@ -184,8 +184,14 @@ sub Send {
         }
     }
 
+    # Make sure %user_cache has every user in it so far referenced
+    foreach my $user_id (keys %recipients) {
+        $user_cache{$user_id} ||= new Bugzilla::User($user_id);
+    }
+    
     Bugzilla::Hook::process('bugmail_recipients',
-                            { bug => $bug, recipients => \%recipients });
+                            { bug => $bug, recipients => \%recipients,
+                              users => \%user_cache });
 
     # Find all those user-watching anyone on the current list, who is not
     # on it already themselves.
index b48ebb9faa786cd0543878bb540d0ca32a785514..1b4bdd9719932f29d1d4943b30c1b09a7a0d1b70 100644 (file)
@@ -494,6 +494,14 @@ as though he were on the CC list:
 (We use C<+> in front of C<REL_CC> so that Perl interprets it as a constant
 instead of as a string.)
 
+=item C<users>
+
+This is a hash of L<Bugzilla::User> objects, keyed by id. This is so you can
+find out more information about any of the user ids in the C<recipients> hash.
+Every id in the incoming C<recipients> hash will have an object in here. 
+(But if you add additional recipients to the C<recipients> hash, you are 
+B<not> required to add them to this hash.)
+
 =back