$this->dieUsageMsg( reset( $retval ) ); // We don't care about multiple errors, just report one of them
}
- if ( $params['watch'] || $wgUser->getOption( 'watchdeletion' ) ) {
- $articleObj->doWatch();
+ $watch = 'nochange';
+ // Deprecated parameters
+ if ( $params['watch'] ) {
+ $watch = 'watch';
} elseif ( $params['unwatch'] ) {
- $articleObj->doUnwatch();
+ $watch = 'unwatch';
+ } else {
+ $watch = $params['watchlist'];
}
+ $this->setWatch( $watch, $titleObj, 'watchdeletion' );
}
$r = array( 'title' => $titleObj->getPrefixedText(), 'reason' => $reason );
),
'token' => null,
'reason' => null,
- 'watch' => false,
+ 'watch' => array(
+ ApiBase::PARAM_DFLT => false,
+ ApiBase::PARAM_DEPRECATED => true,
+ ),
+ 'watchlist' => array(
+ ApiBase::PARAM_DFLT => 'preferences',
+ ApiBase::PARAM_TYPE => array(
+ 'watch',
+ 'unwatch',
+ 'preferences',
+ 'nochange'
+ ),
+ ),
'unwatch' => false,
'oldimage' => null
);
'token' => 'A delete token previously retrieved through prop=info',
'reason' => 'Reason for the deletion. If not set, an automatically generated reason will be used.',
'watch' => 'Add the page to your watchlist',
+ 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
'unwatch' => 'Remove the page from your watchlist',
'oldimage' => 'The name of the old image to delete as provided by iiprop=archivename'
);