r49752 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49751‎ | r49752 | r49753 >
Date:04:11, 23 April 2009
Author:nad
Status:deferred
Tags:
Comment:
Can't use wikitext links because email content is text
Modified paths:
  • /trunk/extensions/CategoryWatch/CategoryWatch.i18n.php (modified) (history)
  • /trunk/extensions/CategoryWatch/CategoryWatch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryWatch/CategoryWatch.i18n.php
@@ -13,10 +13,10 @@
1414 $messages['en'] = array(
1515 'categorywatch-desc' => 'Extends watchlist functionality to include notification about membership changes of watched categories',
1616 'categorywatch-emailsubject' => "Activity involving watched category \"$1\"",
17 - 'categorywatch-catmovein' => "[[$1]] has moved into [[:Category:$2]] from [[:Category:$3]]",
18 - 'categorywatch-catmoveout' => "[[$1]] has moved out of [[:Category:$2]] into [[:Category:$3]]",
19 - 'categorywatch-catadd' => "[[$1]] has been added to [[:Category:$2]]",
20 - 'categorywatch-catsub' => "[[$1]] has been removed from [[:Category:$2]]",
 17+ 'categorywatch-catmovein' => "$1 has moved into $2 from $3",
 18+ 'categorywatch-catmoveout' => "$1 has moved out of $2 into $3",
 19+ 'categorywatch-catadd' => "$1 has been added to $2",
 20+ 'categorywatch-catsub' => "$1 has been removed from $2",
2121 'categorywatch-autocat' => "Automatically watched by $1",
2222 );
2323
Index: trunk/extensions/CategoryWatch/CategoryWatch.php
@@ -140,16 +140,18 @@
141141 $res = $dbr->select( 'watchlist', array( 'wl_user' ), $conds, __METHOD__ );
142142
143143 # Wrap message with common body and send to each watcher
144 - $page = $title->getText();
145 - $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
146 - $editorAddress = new MailAddress( $editor );
 144+ $page = $title->getPrefixedText();
 145+ $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
 146+ $editorAddress = new MailAddress( $editor );
 147+ $timecorrection = $watchingUser->getOption( 'timecorrection' );
 148+ $editdate = $wgLang->timeanddate( wfTimestampNow(), true, false, $timecorrection );
147149 foreach ( $res as $row ) {
148150 $watchingUser = User::newFromId( $row->wl_user );
149151 if ( $watchingUser->getOption( 'enotifwatchlistpages' ) && $watchingUser->isEmailConfirmed() ) {
150152
151 - $to = new MailAddress( $watchingUser );
 153+ $to = new MailAddress( $watchingUser );
152154 $subject = wfMsg( 'categorywatch-emailsubject', $page );
153 - $body = wfMsgForContent( 'enotif_body' );
 155+ $body = wfMsgForContent( 'enotif_body' );
154156
155157 # Reveal the page editor's address as REPLY-TO address only if
156158 # the user has not opted-out and the option is enabled at the
@@ -170,10 +172,16 @@
171173 }
172174
173175 # Define keys for body message
 176+ $userPage = $editor->getUserPage();
174177 $keys = array(
175178 '$NEWPAGE' => $message,
 179+ '$PAGETITLE' => $page;
 180+ '$PAGEEDITDATE' => $editdate;
176181 '$CHANGEDORCREATED' => wfMsgForContent( 'created' ),
177 - '$OLDID' => ''
 182+ '$PAGETITLE_URL' => $title->getFullUrl(),
 183+ '$PAGEEDITOR_WIKI' => $userPage->getFullUrl(),
 184+ '$OLDID' => '',
 185+ '$PAGEMINOREDIT' => ''
178186 );
179187 if ( $editor->isIP( $name ) ) {
180188 $utext = wfMsgForContent( 'enotif_anon_editor', $name );
@@ -186,8 +194,7 @@
187195 $emailPage = SpecialPage::getSafeTitleFor( 'Emailuser', $name );
188196 $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getFullUrl();
189197 }
190 - $userPage = $editor->getUserPage();
191 - $keys['$PAGEEDITOR_WIKI'] = $userPage->getFullUrl();
 198+ $keys['$PAGESUMMARY'] = $summary;
192199
193200 # Replace keys, wrap text and send
194201 $body = strtr( $body, $keys );

Status & tagging log