Update documentation for EmailUser hooks
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 19 Sep 2015 18:50:37 +0000 (20:50 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sun, 20 Sep 2015 18:04:30 +0000 (18:04 +0000)
Document the missing $error parameter of the EmailUser hook.
Clarify the type of the address parameter
Also add an comment, why a variable is used twice

Follows 38c7c8f895f75ac04dbb6e0349779171f8a8e8a1 (r64903)

Change-Id: I1c5636dc378667ef2798c69659b43f70734f4144

docs/hooks.txt
includes/specials/SpecialEmailuser.php

index 54ab46c..81bf861 100644 (file)
@@ -1271,20 +1271,21 @@ $user: User being checked
 $confirmed: Whether or not the email address is confirmed
 
 'EmailUser': Before sending email from one user to another.
-$to: address of receiving user
-$from: address of sending user
+$to: MailAddress object of receiving user
+$from: MailAddress object of sending user
 $subject: subject of the mail
 $text: text of the mail
+&$error: Out-param for an error
 
 'EmailUserCC': Before sending the copy of the email to the author.
-$to: address of receiving user
-$from: address of sending user
+$to: MailAddress object of receiving user
+$from: MailAddress object of sending user
 $subject: subject of the mail
 $text: text of the mail
 
 'EmailUserComplete': After sending email from one user to another.
-$to: address of receiving user
-$from: address of sending user
+$to: MailAddress object of receiving user
+$from: MailAddress object of sending user
 $subject: subject of the mail
 $text: text of the mail
 
index 1754471..92cb8bf 100644 (file)
@@ -369,7 +369,10 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        if ( $data['CCMe'] && $to != $from ) {
                                $cc_subject = $context->msg( 'emailccsubject' )->rawParams(
                                        $target->getName(), $subject )->text();
+
+                               // target and sender are equal, because this is the CC for the sender
                                Hooks::run( 'EmailUserCC', array( &$from, &$from, &$cc_subject, &$text ) );
+
                                $ccStatus = UserMailer::send( $from, $from, $cc_subject, $text );
                                $status->merge( $ccStatus );
                        }