From ce4890b4168011fda5befee65d7828d73df0ed20 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Mon, 12 Apr 2010 15:44:33 +0000 Subject: [PATCH] re r64291 and r64852 use ApiBase::setWatch instead of wgUser->*Watch to set watches so that all api watch changes act the same. --- includes/api/ApiMove.php | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index 464785973d..2752448577 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -121,26 +121,21 @@ class ApiMove extends ApiBase { $this->getResult()->setIndexedTagName( $r['subpages-talk'], 'subpage' ); } } - - // Watch pages - $watch = $this->getWatchlistValue( $params['watchlist'], $fromTitle ) || $wgUser->getOption( 'watchmoves' ); - - // Deprecated parameters + + $watch = $params['watchlist']; + if ( $wgUser->getOption( 'watchmoves' ) ) { + $watch = 'watch'; + } if ( $params['watch'] ) { - $watch = true; + $watch = 'watch'; } elseif ( $params['unwatch'] ) { - $watch = false; + $watch = 'unwatch'; } - if ( $watch !== null ) { - if ( $watch ) { - $wgUser->addWatch( $fromTitle ); - $wgUser->addWatch( $toTitle ); - } else { - $wgUser->removeWatch( $fromTitle ); - $wgUser->removeWatch( $toTitle ); - } - } + // Watch pages + $this->setWatch( $watch, $fromTitle ); + $this->setWatch( $watch, $toTitle ); + $this->getResult()->addValue( null, $this->getModuleName(), $r ); } -- 2.20.1