Index: trunk/phase3/includes/api/ApiUndelete.php |
— | — | @@ -81,17 +81,9 @@ |
82 | 82 | wfRunHooks( 'FileUndeleteComplete', |
83 | 83 | array( $titleObj, array(), $wgUser, $params['reason'] ) ); |
84 | 84 | } |
85 | | - |
86 | | - $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj ); |
87 | | - |
88 | | - if ( $watch !== null ) { |
89 | | - if ( $watch ) { |
90 | | - $wgUser->addWatch( $titleObj ); |
91 | | - } else { |
92 | | - $wgUser->removeWatch( $titleObj ); |
93 | | - } |
94 | | - } |
95 | 85 | |
| 86 | + $this->setWatch( $params['watchlist'], $titleObj ); |
| 87 | + |
96 | 88 | $info['title'] = $titleObj->getPrefixedText(); |
97 | 89 | $info['revisions'] = intval( $retval[0] ); |
98 | 90 | $info['fileversions'] = intval( $retval[1] ); |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -551,7 +551,7 @@ |
552 | 552 | |
553 | 553 | case 'preferences': |
554 | 554 | global $wgUser; |
555 | | - if ( isset($titleObj) && !$titleObj->userIsWatching() ) { |
| 555 | + if ( isset($titleObj) && !$titleObj->userIsWatching() ) { |
556 | 556 | if ( $titleObj->exists() ) { |
557 | 557 | if ( $wgUser->getOption( 'watchdefault' ) ) { |
558 | 558 | return true; |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -248,7 +248,7 @@ |
249 | 249 | } |
250 | 250 | |
251 | 251 | $file = $this->mUpload->getLocalFile(); |
252 | | - $watch = $this->getWatchlistValue( $params['watchlist'], $file->getTitle() ); |
| 252 | + $watch = $this->getWatchlistValue( $this->mParams['watchlist'], $file->getTitle() ); |
253 | 253 | |
254 | 254 | // Deprecated parameters |
255 | 255 | if ( $this->mParams['watch'] ) { |