r22662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22661‎ | r22662 | r22663 >
Date:18:41, 2 June 2007
Author:aaron
Status:old
Tags:
Comment:
*Modify $wgFlaggedRevsWatch
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -68,7 +68,7 @@
6969 $wgFlaggedRevsAnonOnly = true;
7070 # Can users make comments that will show up below flagged revisions?
7171 $wgFlaggedRevComments = true;
72 -# Make user's watch pages when reviewed
 72+# Make user's watch pages when reviewed if they watch pages that they edit
7373 $wgFlaggedRevsWatch = true;
7474 # How long to cache stable versions? (seconds)
7575 $wgFlaggedRevsExpire = 7 * 24 * 3600;
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php
@@ -258,7 +258,7 @@
259259 * Adds or updates the flagged revision table for this page/id set
260260 */
261261 function approveRevision( $rev=NULL, $notes='' ) {
262 - global $wgUser, $wgParser, $wgFlaggedRevsWatch;
 262+ global $wgUser, $wgFlaggedRevsWatch, $wgParser;
263263
264264 wfProfileIn( __METHOD__ );
265265
@@ -274,9 +274,6 @@
275275 }
276276 // Get the page this corresponds to
277277 $title = $rev->getTitle();
278 - // Watch it if $wgFlaggedRevsWatch is set to true
279 - if( $wgFlaggedRevsWatch )
280 - $wgUser->addWatch( $title );
281278 // Our flags
282279 $flagset = array();
283280 foreach( $this->dims as $tag => $value ) {
@@ -360,6 +357,10 @@
361358 $u = new LinksUpdate( $this->page, $poutput );
362359 $u->doUpdate(); // this will trigger our hook to add stable links too...
363360
 361+ // Watch it if $wgFlaggedRevsWatch is set to true and this users watches his/her edits
 362+ if( $wgFlaggedRevsWatch && $wgUser->getOption( 'watchdefault' ) )
 363+ $wgUser->addWatch( $title );
 364+
364365 # Clear the cache...
365366 $this->page->invalidateCache();
366367 # Might as well save the cache
@@ -375,7 +376,7 @@
376377 * Removes flagged revision data for this page/id set
377378 */
378379 function unapproveRevision( $row=NULL ) {
379 - global $wgUser;
 380+ global $wgUser, $wgFlaggedRevsWatch;
380381
381382 wfProfileIn( __METHOD__ );
382383
@@ -407,6 +408,10 @@
408409 $u = new LinksUpdate( $this->page, $poutput );
409410 $u->doUpdate();
410411
 412+ // Watch it if $wgFlaggedRevsWatch is set to true and this users watches his/her edits
 413+ if( $wgFlaggedRevsWatch && $wgUser->getOption( 'watchdefault' ) )
 414+ $wgUser->addWatch( $title );
 415+
411416 # Clear the cache...
412417 $this->page->invalidateCache();
413418 # Might as well save the cache

Status & tagging log