r104752 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104751‎ | r104752 | r104753 >
Date:21:25, 30 November 2011
Author:krinkle
Status:ok
Tags:
Comment:
[WikiLove] api documentation copyedit.
* Document behavior if 'email' is given but user cannot be e-mailed (most likely because user is not emaillable, no confirmed address)
Modified paths:
  • /trunk/extensions/WikiLove/ApiWikiLove.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiLove/ApiWikiLove.php
@@ -88,6 +88,7 @@
8989 */
9090 private function emailUser( $talk, $subject, $text, $token ) {
9191 global $wgRequest;
 92+
9293 $api = new ApiMain( new FauxRequest( array(
9394 'action' => 'emailuser',
9495 'target' => User::newFromName( $talk->getSubjectPage()->getBaseText() )->getName(),
@@ -95,7 +96,8 @@
9697 'text' => $text,
9798 'token' => $token,
9899 ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true );
99 - try{
 100+
 101+ try {
100102 $api->execute();
101103 } catch( DBQueryError $dbqe ) {
102104 $this->setWarning( 'E-mail was not sent' );
@@ -141,7 +143,9 @@
142144 'or when on a MediaWiki page through mw.user.tokens',
143145 ),
144146 'subject' => 'Subject header of the new section',
145 - 'email' => 'Content of the optional e-mail message to send to the user',
 147+ 'email' => array( 'Content of the optional e-mail message to send to the user.',
 148+ 'A warning will be returned if the user cannot be e-mailed. WikiLove will be sent to user talk page either way.',
 149+ ),
146150 'type' => array( 'Type of WikiLove (for statistics); this corresponds with a type',
147151 'selected in the left menu, and optionally a subtype after that',
148152 '(e.g. "barnstar-normal" or "kitten")',

Status & tagging log