X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=2443470ef5f701142e959dd1ba77765eebc12621;hb=a6a6c19c794619c24881d2d984dc18ceb3b6419b;hp=812f1b00ab5c6a26a9ce376071445e2f7b001a32;hpb=7159f97a55aa384706747b03726b42d9dcee8782;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 812f1b00ab..2443470ef5 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -554,6 +554,9 @@ class SpecialWatchlist extends ChangesListSpecialPage { $rc->numberofWatchingusers = 0; } + // XXX: this treats pages with no unseen changes as "not on the watchlist" since + // everything is on the watchlist and it is an easy way to make pages with unseen + // changes appear bold. @TODO: clean this up. $changeLine = $list->recentChangesLine( $rc, $unseen, $counter ); if ( $changeLine !== false ) { $s .= $changeLine; @@ -865,19 +868,19 @@ class SpecialWatchlist extends ChangesListSpecialPage { * @return bool User viewed the revision or a newer one */ protected function isChangeEffectivelySeen( RecentChange $rc ) { - $lastVisitTs = $this->getLatestSeenTimestampIfHasUnseen( $rc ); + $firstUnseen = $this->getLatestNotificationTimestamp( $rc ); - return $lastVisitTs === null || $lastVisitTs > $rc->getAttribute( 'rc_timestamp' ); + return ( $firstUnseen === null || $firstUnseen > $rc->getAttribute( 'rc_timestamp' ) ); } /** * @param RecentChange $rc - * @return string|null TS_MW timestamp or null if all revision were seen + * @return string|null TS_MW timestamp of first unseen revision or null if there isn't one */ - private function getLatestSeenTimestampIfHasUnseen( RecentChange $rc ) { + private function getLatestNotificationTimestamp( RecentChange $rc ) { return $this->watchStore->getLatestNotificationTimestamp( $rc->getAttribute( 'wl_notificationtimestamp' ), - $rc->getPerformer(), + $this->getUser(), $rc->getTitle() ); }