re r64291 and r64852 use ApiBase::setWatch instead of wgUser->*Watch to set watches...
authorMark A. Hershberger <mah@users.mediawiki.org>
Mon, 12 Apr 2010 15:44:33 +0000 (15:44 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Mon, 12 Apr 2010 15:44:33 +0000 (15:44 +0000)
includes/api/ApiMove.php

index 4647859..2752448 100644 (file)
@@ -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 );
        }