From 0a4586c2235653d287387b448200954cdb51f704 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Thu, 20 May 2010 02:12:04 +0000 Subject: [PATCH] * 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 --- docs/hooks.txt | 20 ++++++++++++++++++++ includes/User.php | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) 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 -- 2.20.1