* Since it makes sense (to me :) to make the arguments for the two UserMessage hooks...
authorMark A. Hershberger <mah@users.mediawiki.org>
Thu, 20 May 2010 02:12:04 +0000 (02:12 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Thu, 20 May 2010 02:12:04 +0000 (02:12 +0000)
* Document these hooks in doc/hooks.txt

docs/hooks.txt
includes/User.php

index 2e080f7..2c63389 100644 (file)
@@ -263,6 +263,16 @@ $message: out parameter: error message to display on abort
 $user: the User object that was created. (Parameter added in 1.7)
 $byEmail: true when account was created "by email" (added in 1.12)
 
+‘AfterUserMessage': After a user message has been left, this hook is
+called to take care of any cleanup.
+$user: The user who we left the message for.
+$article: The article the message was left on.
+$subject: The subject of the message
+$text: The text of the message.
+$signature: The signature we used.
+$summary: The edit summary.
+$editor: The editor that performed the edit.
+
 'AjaxAddScript': Called in output page just before the initialisation
 of the javascript ajax engine. The hook is only called when ajax
 is enabled ( $wgUseAjax = true; ).
@@ -1327,6 +1337,16 @@ $query : Original query.
 
 'SetupAfterCache': Called in Setup.php, after cache objects are set
 
+‘SetupUserMessageArticle': Called in User::leaveUserMessage() after
+before anything has been posted to the article.
+$user: The user who we left the message for.
+&$article: The article that will be posted to.
+$subject: The subject of the message
+$text: The text of the message.
+$signature: The signature we used.
+$summary: The edit summary.
+$editor: The editor that performed the edit.
+
 'ShowMissingArticle': Called when generating the output for a non-existent page
 $article: The article object corresponding to the page
 
index 1853cb1..e7910c9 100644 (file)
@@ -3777,7 +3777,7 @@ class User {
 
                $article = new Article( $this->getTalkPage() );
                wfRunHooks( 'SetupUserMessageArticle',
-                       array( &$article, $subject, $this, $editor ) );
+                       array( $this, &$article, $subject, $text, $signature, $summary, $editor ) );
 
                $flags = $article->checkFlags( $flags );
 
@@ -3798,7 +3798,7 @@ class User {
                        // Set newtalk with the right user ID
                        $this->setNewtalk( true );
                        wfRunHooks( 'AfterUserMessage',
-                               array( $this, $article, $summary, $signature, $editor, $text ) );
+                               array( $this, $article, $summary, $text, $signature, $summary, $editor ) );
                        $dbw->commit();
                } else {
                        // The article was concurrently created