Index: trunk/extensions/WikiLove/ApiWikiLove.php |
— | — | @@ -88,6 +88,7 @@ |
89 | 89 | */ |
90 | 90 | private function emailUser( $talk, $subject, $text, $token ) { |
91 | 91 | global $wgRequest; |
| 92 | + |
92 | 93 | $api = new ApiMain( new FauxRequest( array( |
93 | 94 | 'action' => 'emailuser', |
94 | 95 | 'target' => User::newFromName( $talk->getSubjectPage()->getBaseText() )->getName(), |
— | — | @@ -95,7 +96,8 @@ |
96 | 97 | 'text' => $text, |
97 | 98 | 'token' => $token, |
98 | 99 | ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true ); |
99 | | - try{ |
| 100 | + |
| 101 | + try { |
100 | 102 | $api->execute(); |
101 | 103 | } catch( DBQueryError $dbqe ) { |
102 | 104 | $this->setWarning( 'E-mail was not sent' ); |
— | — | @@ -141,7 +143,9 @@ |
142 | 144 | 'or when on a MediaWiki page through mw.user.tokens', |
143 | 145 | ), |
144 | 146 | '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 | + ), |
146 | 150 | 'type' => array( 'Type of WikiLove (for statistics); this corresponds with a type', |
147 | 151 | 'selected in the left menu, and optionally a subtype after that', |
148 | 152 | '(e.g. "barnstar-normal" or "kitten")', |