jenkins-bot has submitted this change and it was merged.
Change subject: Add show=unpatrolled to the recentchanges API
..
Add show=unpatrolled to the recentchanges API
Adding it only in the API because SpecialRecentChanges only shows
"Hide patrolled edits" option if rcpatrol is enabled.
show=!patrolled returns results that include changes that can't
be patrolled which technically correct (they aren't correct)
but probably not what you're looking for when looking for
unpatrolled changes.
Change-Id: I356a8625c7126b90aa7e7a23efe3bef7d448b502
---
M includes/api/ApiQueryRecentChanges.php
1 file changed, 15 insertions(+), 2 deletions(-)
Approvals:
Anomie: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiQueryRecentChanges.php
b/includes/api/ApiQueryRecentChanges.php
index 7848853..50a3352 100644
--- a/includes/api/ApiQueryRecentChanges.php
+++ b/includes/api/ApiQueryRecentChanges.php
@@ -192,12 +192,14 @@
|| ( isset( $show['anon'] ) && isset(
$show['!anon'] ) )
|| ( isset( $show['redirect'] ) && isset(
$show['!redirect'] ) )
|| ( isset( $show['patrolled'] ) && isset(
$show['!patrolled'] ) )
+ || ( isset( $show['patrolled'] ) && isset(
$show['unpatrolled'] ) )
+ || ( isset( $show['!patrolled'] ) && isset(
$show['unpatrolled'] ) )
) {
$this->dieUsageMsg( 'show' );
}
// Check permissions
- if ( isset( $show['patrolled'] ) || isset(
$show['!patrolled'] ) ) {
+ if ( isset( $show['patrolled'] ) || isset(
$show['!patrolled'] ) || isset( $show['unpatrolled'] ) ) {
if ( !$user->useRCPatrol() &&
!$user->useNPPatrol() ) {
$this->dieUsage(
'You need the patrol right to
request the patrolled flag',
@@ -216,6 +218,16 @@
$this->addWhereIf( 'rc_patrolled = 0', isset(
$show['!patrolled'] ) );
$this->addWhereIf( 'rc_patrolled != 0', isset(
$show['patrolled'] ) );
$this->addWhereIf( 'page_is_redirect = 1', isset(
$show['redirect'] ) );
+
+ if ( isset( $show['unpatrolled'] ) ) {
+ // See ChangesList:isUnpatrolled
+ if ( $user->useRCPatrol() ) {
+ $this->addWhere( 'rc_patrolled = 0' );
+ } elseif ( $user->useNPPatrol() ) {
+ $this->addWhere( 'rc_patrolled = 0' );
+ $this->addWhereFld( 'rc_type', RC_NEW );
+ }
+ }
// Don't throw log entries out the window here
$this->addWhereIf(
@@ -639,7 +651,8 @@
'redirect',
'!redirect',
'patrolled',
- '!patrolled'
+ '!patrolled',
+ 'unpatrolled'
)
),
'limit' => array(
--
To view, visit https://gerrit.wikimedia.org/r/91845
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I356a8625c7126b90aa7e7a23efe3bef7d448b502
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle
Gerrit-Reviewer: Anomie
Gerrit-Reviewer: Krinkle
Gerrit-Reviewer: Parent5446
Gerrit-Reviewer: jenkins-bot
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits