Index: trunk/phase3/includes/api/ApiMove.php |
— | — | @@ -121,26 +121,21 @@ |
122 | 122 | $this->getResult()->setIndexedTagName( $r['subpages-talk'], 'subpage' ); |
123 | 123 | } |
124 | 124 | } |
125 | | - |
126 | | - // Watch pages |
127 | | - $watch = $this->getWatchlistValue( $params['watchlist'], $fromTitle ) || $wgUser->getOption( 'watchmoves' ); |
128 | | - |
129 | | - // Deprecated parameters |
| 125 | + |
| 126 | + $watch = $params['watchlist']; |
| 127 | + if ( $wgUser->getOption( 'watchmoves' ) ) { |
| 128 | + $watch = 'watch'; |
| 129 | + } |
130 | 130 | if ( $params['watch'] ) { |
131 | | - $watch = true; |
| 131 | + $watch = 'watch'; |
132 | 132 | } elseif ( $params['unwatch'] ) { |
133 | | - $watch = false; |
| 133 | + $watch = 'unwatch'; |
134 | 134 | } |
135 | 135 | |
136 | | - if ( $watch !== null ) { |
137 | | - if ( $watch ) { |
138 | | - $wgUser->addWatch( $fromTitle ); |
139 | | - $wgUser->addWatch( $toTitle ); |
140 | | - } else { |
141 | | - $wgUser->removeWatch( $fromTitle ); |
142 | | - $wgUser->removeWatch( $toTitle ); |
143 | | - } |
144 | | - } |
| 136 | + // Watch pages |
| 137 | + $this->setWatch( $watch, $fromTitle ); |
| 138 | + $this->setWatch( $watch, $toTitle ); |
| 139 | + |
145 | 140 | $this->getResult()->addValue( null, $this->getModuleName(), $r ); |
146 | 141 | } |
147 | 142 | |