r49811 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49810‎ | r49811 | r49812 >
Date:09:57, 24 April 2009
Author:nad
Status:deferred
Tags:
Comment:
include summary and minor edit in emailed message
Modified paths:
  • /trunk/extensions/CategoryWatch/CategoryWatch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryWatch/CategoryWatch.php
@@ -80,7 +80,7 @@
8181 /**
8282 * Find changes in categorisation and send messages to watching users
8383 */
84 - function onArticleSaveComplete( &$article, &$user, &$text ) {
 84+ function onArticleSaveComplete( &$article, &$user, &$text, &$summary, &$medit, ) {
8585
8686 # Get cats after update
8787 $this->after = array();
@@ -102,31 +102,31 @@
103103 $pagename = $page->getPrefixedText();
104104 $pageurl = $page->getFullUrl();
105105 $page = "$pagename ($pageurl)";
106 -
 106+
107107 if ( count( $add ) == 1 && count( $sub ) == 1 ) {
108108 $add = array_shift( $add );
109109 $sub = array_shift( $sub );
110110
111111 $title = Title::newFromText( $add, NS_CATEGORY );
112112 $message = wfMsg( 'categorywatch-catmovein', $page, $this->friendlyCat( $add ), $this->friendlyCat( $sub ) );
113 - $this->notifyWatchers( $title, $user, $message );
 113+ $this->notifyWatchers( $title, $user, $message, $summary, $medit );
114114
115115 #$title = Title::newFromText( $sub, NS_CATEGORY );
116116 #$message = wfMsg( 'categorywatch-catmoveout', $page, $this->friendlyCat( $sub ), $this->friendlyCat( $add ) );
117 - #$this->notifyWatchers( $title, $user, $message );
 117+ #$this->notifyWatchers( $title, $user, $message, $summary, $medit );
118118 }
119119 else {
120120
121121 foreach ( $add as $cat ) {
122122 $title = Title::newFromText( $cat, NS_CATEGORY );
123123 $message = wfMsg( 'categorywatch-catadd', $page, $this->friendlyCat( $cat ) );
124 - $this->notifyWatchers( $title, $user, $message );
 124+ $this->notifyWatchers( $title, $user, $message, $summary, $medit );
125125 }
126126
127127 #foreach ( $sub as $cat ) {
128128 # $title = Title::newFromText( $cat, NS_CATEGORY );
129129 # $message = wfMsg( 'categorywatch-catsub', $page, $this->friendlyCat( $cat ) );
130 - # $this->notifyWatchers( $title, $user, $message );
 130+ # $this->notifyWatchers( $title, $user, $message, $summary, $medit );
131131 #}
132132 }
133133 }
@@ -144,7 +144,7 @@
145145 return "$catname ($caturl)";
146146 }
147147
148 - function notifyWatchers( &$title, &$editor, &$message ) {
 148+ function notifyWatchers( &$title, &$editor, &$message, &$summary, &$medit ) {
149149 global $wgLang, $wgEmergencyContact, $wgNoReplyAddress, $wgCategoryWatchNotifyEditor,
150150 $wgEnotifRevealEditorAddress, $wgEnotifUseRealName, $wgPasswordSender, $wgEnotifFromEditor;
151151
@@ -158,6 +158,8 @@
159159 $page = $title->getPrefixedText();
160160 $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
161161 $editorAddress = new MailAddress( $editor );
 162+ $summary = $summary ? $summary : ' - ';
 163+ $medit = $medit ? wfMsg( 'minoredit' ) : '';
162164 while ( $row = $dbr->fetchRow( $res ) ) {
163165 $watchingUser = User::newFromId( $row[0] );
164166 $timecorrection = $watchingUser->getOption( 'timecorrection' );
@@ -196,8 +198,9 @@
197199 '$CHANGEDORCREATED' => wfMsgForContent( 'changed' ),
198200 '$PAGETITLE_URL' => $title->getFullUrl(),
199201 '$PAGEEDITOR_WIKI' => $userPage->getFullUrl(),
200 - '$OLDID' => '',
201 - '$PAGEMINOREDIT' => ''
 202+ '$PAGESUMMARY' => $summary,
 203+ '$PAGEMINOREDIT' => $medit,
 204+ '$OLDID' => ''
202205 );
203206 if ( $editor->isIP( $name ) ) {
204207 $utext = wfMsgForContent( 'enotif_anon_editor', $name );

Status & tagging log