X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=6defc9de4f7ef59723255fe4400aa9c8abb4b3e4;hb=a38af7ba26579bb3004f673e44d39710887763aa;hp=4d2fc62dde7d3f449f5e7405ab8efca7ed4e85eb;hpb=5537b54249ba8d70cdf97e5a20a35c4249b33327;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 4d2fc62dde..6defc9de4f 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -37,12 +37,16 @@ class SpecialWatchlist extends ChangesListSpecialPage { protected static $limitPreferenceName = 'wllimit'; protected static $collapsedPreferenceName = 'rcfilters-wl-collapsed'; + /** @var float|int */ private $maxDays; + /** WatchedItemStore */ + private $watchStore; public function __construct( $page = 'Watchlist', $restriction = 'viewmywatchlist' ) { parent::__construct( $page, $restriction ); $this->maxDays = $this->getConfig()->get( 'RCMaxAge' ) / ( 3600 * 24 ); + $this->watchStore = MediaWikiServices::getInstance()->getWatchedItemStore(); } public function doesWrites() { @@ -187,9 +191,13 @@ class SpecialWatchlist extends ChangesListSpecialPage { 'label' => 'rcfilters-filter-watchlistactivity-unseen-label', 'description' => 'rcfilters-filter-watchlistactivity-unseen-description', 'cssClassSuffix' => 'watchedunseen', - 'isRowApplicableCallable' => function ( $ctx, $rc ) { + 'isRowApplicableCallable' => function ( $ctx, RecentChange $rc ) { $changeTs = $rc->getAttribute( 'rc_timestamp' ); - $lastVisitTs = $rc->getAttribute( 'wl_notificationtimestamp' ); + $lastVisitTs = $this->watchStore->getLatestNotificationTimestamp( + $rc->getAttribute( 'wl_notificationtimestamp' ), + $rc->getPerformer(), + $rc->getTitle() + ); return $lastVisitTs !== null && $changeTs >= $lastVisitTs; }, ],