Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | $wgFlaggedRevsAnonOnly = true; |
70 | 70 | # Can users make comments that will show up below flagged revisions? |
71 | 71 | $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 |
73 | 73 | $wgFlaggedRevsWatch = true; |
74 | 74 | # How long to cache stable versions? (seconds) |
75 | 75 | $wgFlaggedRevsExpire = 7 * 24 * 3600; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php |
— | — | @@ -258,7 +258,7 @@ |
259 | 259 | * Adds or updates the flagged revision table for this page/id set |
260 | 260 | */ |
261 | 261 | function approveRevision( $rev=NULL, $notes='' ) { |
262 | | - global $wgUser, $wgParser, $wgFlaggedRevsWatch; |
| 262 | + global $wgUser, $wgFlaggedRevsWatch, $wgParser; |
263 | 263 | |
264 | 264 | wfProfileIn( __METHOD__ ); |
265 | 265 | |
— | — | @@ -274,9 +274,6 @@ |
275 | 275 | } |
276 | 276 | // Get the page this corresponds to |
277 | 277 | $title = $rev->getTitle(); |
278 | | - // Watch it if $wgFlaggedRevsWatch is set to true |
279 | | - if( $wgFlaggedRevsWatch ) |
280 | | - $wgUser->addWatch( $title ); |
281 | 278 | // Our flags |
282 | 279 | $flagset = array(); |
283 | 280 | foreach( $this->dims as $tag => $value ) { |
— | — | @@ -360,6 +357,10 @@ |
361 | 358 | $u = new LinksUpdate( $this->page, $poutput ); |
362 | 359 | $u->doUpdate(); // this will trigger our hook to add stable links too... |
363 | 360 | |
| 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 | + |
364 | 365 | # Clear the cache... |
365 | 366 | $this->page->invalidateCache(); |
366 | 367 | # Might as well save the cache |
— | — | @@ -375,7 +376,7 @@ |
376 | 377 | * Removes flagged revision data for this page/id set |
377 | 378 | */ |
378 | 379 | function unapproveRevision( $row=NULL ) { |
379 | | - global $wgUser; |
| 380 | + global $wgUser, $wgFlaggedRevsWatch; |
380 | 381 | |
381 | 382 | wfProfileIn( __METHOD__ ); |
382 | 383 | |
— | — | @@ -407,6 +408,10 @@ |
408 | 409 | $u = new LinksUpdate( $this->page, $poutput ); |
409 | 410 | $u->doUpdate(); |
410 | 411 | |
| 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 | + |
411 | 416 | # Clear the cache... |
412 | 417 | $this->page->invalidateCache(); |
413 | 418 | # Might as well save the cache |