From 027658bd87981fac575a561589dedd5fa9a569b9 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 4 Feb 2016 09:42:57 -0500 Subject: [PATCH] ApiQueryWatchlist: wlshow=unread should filter revisions, not pages It's currently showing all relevant revisions from pages with at least one unread revision, where it would be more sensible for it to show just the unread revisions. Something similar applies to wlshow=!unread. Bug: T125729 Change-Id: I552901efb98081af9a1a677f4403a2a1a73bd94f --- includes/api/ApiQueryWatchlist.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 7e561cbfe7..db2cf86714 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -192,8 +192,11 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $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'] ) ); + $this->addWhereIf( 'rc_timestamp >= wl_notificationtimestamp', isset( $show['unread'] ) ); + $this->addWhereIf( + 'wl_notificationtimestamp IS NULL OR rc_timestamp < wl_notificationtimestamp', + isset( $show['!unread'] ) + ); } if ( !is_null( $params['type'] ) ) { -- 2.20.1