From: Mark A. Hershberger Date: Thu, 20 May 2010 02:12:04 +0000 (+0000) Subject: * Since it makes sense (to me :) to make the arguments for the two UserMessage hooks... X-Git-Tag: 1.31.0-rc.0~36786 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=0a4586c2235653d287387b448200954cdb51f704;p=lhc%2Fweb%2Fwiklou.git * Since it makes sense (to me :) to make the arguments for the two UserMessage hooks more uniform, do it. * Document these hooks in doc/hooks.txt --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 2e080f7cb9..2c633893bd 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/User.php b/includes/User.php index 1853cb1389..e7910c91fe 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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