$articleObj = new Article( $titleObj );
if ( $params['watch'] ) {
$articleObj->doWatch();
+ } elseif ( $params['unwatch'] ) {
+ $articleObj->doUnwatch();
}
+
if ( $titleObj->exists() ) {
$ok = $articleObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray );
} else {
'reason' => '',
'cascade' => false,
'watch' => false,
+ 'unwatch' => false,
);
}
'cascade' => array( 'Enable cascading protection (i.e. protect pages included in this page)',
'Ignored if not all protection levels are \'sysop\' or \'protect\'' ),
'watch' => 'If set, add the page being (un)protected to your watchlist',
+ 'unwatch' => 'Remove the page being (un)protected from your watchlist',
);
}
// We don't care about multiple errors, just report one of them
$this->dieUsageMsg( reset( $retval ) );
}
+
+ if ( $params['watch'] || $wgUser->getOption( 'watchdeletion' ) ) {
+ $articleObj->doWatch();
+ } elseif ( $params['unwatch'] ) {
+ $articleObj->doUnwatch();
+ }
$info = array(
'title' => $titleObj->getPrefixedText(),
'user' => null,
'token' => null,
'summary' => null,
- 'markbot' => false
+ 'markbot' => false,
+ 'watch' => false,
+ 'unwatch' => false,
);
}
'user' => 'Name of the user whose edits are to be rolled back. If set incorrectly, you\'ll get a badtoken error.',
'token' => 'A rollback token previously retrieved through prop=revisions',
'summary' => 'Custom edit summary. If not set, default summary will be used.',
- 'markbot' => 'Mark the reverted edits and the revert as bot edits'
+ 'markbot' => 'Mark the reverted edits and the revert as bot edits',
+ 'watch' => 'Add the page to your watchlist',
+ 'unwatch' => 'Remove the page from your watchlist',
);
}
$this->dieUsageMsg( array( 'cannotundelete' ) );
}
+ if ( $params['watch'] ) {
+ $articleObj = new Article( $titleObj );
+ $articleObj->doWatch();
+ } elseif ( $params['unwatch'] ) {
+ $articleObj = new Article( $titleObj );
+ $articleObj->doUnwatch();
+ }
+
if ( $retval[1] ) {
wfRunHooks( 'FileUndeleteComplete',
array( $titleObj, array(), $wgUser, $params['reason'] ) );
'reason' => '',
'timestamps' => array(
ApiBase::PARAM_ISMULTI => true
- )
+ ),
+ 'watch' => false,
+ 'unwatch' => false,
);
}
'token' => 'An undelete token previously retrieved through list=deletedrevs',
'reason' => 'Reason for restoring (optional)',
'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.'
+ 'watch' => 'Add the page to your watchlist',
+ 'unwatch' => 'Remove the page from your watchlist',
);
}