|| ( isset( $show['bot'] ) && isset( $show['!bot'] ) )
|| ( isset( $show['anon'] ) && isset( $show['!anon'] ) )
|| ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
+ || ( isset( $show['unread'] ) && isset( $show['!unread'] ) )
) {
$this->dieUsageMsg( 'show' );
}
$this->addWhereIf( 'rc_user != 0', isset( $show['!anon'] ) );
$this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
$this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
+ $this->addWhereIf( 'wl_notificationtimestamp IS NOT NULL', isset( $show['unread'] ) );
+ $this->addWhereIf( 'wl_notificationtimestamp IS NULL', isset( $show['!unread'] ) );
}
if ( !is_null( $params['type'] ) ) {
if ( !is_null( $params['user'] ) || !is_null( $params['excludeuser'] ) ) {
if ( !$user->isAllowed( 'deletedhistory' ) ) {
$bitmask = Revision::DELETED_USER;
- } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
+ } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
$bitmask = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
} else {
$bitmask = 0;
// entirely from the watchlist, or someone could guess the title.
if ( !$user->isAllowed( 'deletedhistory' ) ) {
$bitmask = LogPage::DELETED_ACTION;
- } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
+ } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
$bitmask = LogPage::DELETED_ACTION | LogPage::DELETED_RESTRICTED;
} else {
$bitmask = 0;
'!anon',
'patrolled',
'!patrolled',
+ 'unread',
+ '!unread',
)
),
'type' => array(
}
public function getResultProperties() {
- global $wgLogTypes;
-
return array(
'' => array(
'type' => array(
ApiBase::PROP_NULLABLE => true
),
'logtype' => array(
- ApiBase::PROP_TYPE => $wgLogTypes,
+ ApiBase::PROP_TYPE => $this->getConfig()->get( 'LogTypes' ),
ApiBase::PROP_NULLABLE => true
),
'logaction' => array(