case 'preferences':
global $wgUser;
- if ( isset($titleObj) && !$titleObj->userIsWatching() ) {
+ if ( isset($titleObj) && !$titleObj->userIsWatching() ) {
if ( $titleObj->exists() ) {
if ( $wgUser->getOption( 'watchdefault' ) ) {
return true;
wfRunHooks( 'FileUndeleteComplete',
array( $titleObj, array(), $wgUser, $params['reason'] ) );
}
-
- $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj );
-
- if ( $watch !== null ) {
- if ( $watch ) {
- $wgUser->addWatch( $titleObj );
- } else {
- $wgUser->removeWatch( $titleObj );
- }
- }
+
+ $this->setWatch( $params['watchlist'], $titleObj );
$info['title'] = $titleObj->getPrefixedText();
$info['revisions'] = intval( $retval[0] );
}
$file = $this->mUpload->getLocalFile();
- $watch = $this->getWatchlistValue( $params['watchlist'], $file->getTitle() );
+ $watch = $this->getWatchlistValue( $this->mParams['watchlist'], $file->getTitle() );
// Deprecated parameters
if ( $this->mParams['watch'] ) {