From: Brad Jorsch Date: Thu, 4 Feb 2016 14:42:57 +0000 (-0500) Subject: ApiQueryWatchlist: wlshow=unread should filter revisions, not pages X-Git-Tag: 1.31.0-rc.0~7914^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/supprimer.php?a=commitdiff_plain;h=027658bd87981fac575a561589dedd5fa9a569b9;p=lhc%2Fweb%2Fwiklou.git 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 --- 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'] ) ) {