X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=6defc9de4f7ef59723255fe4400aa9c8abb4b3e4;hb=a38af7ba26579bb3004f673e44d39710887763aa;hp=d59b66b9ef4233ce6d9aaa165a3a4079ab154753;hpb=b972c452b50dc863a8a9aa622cdd8ff9b5651e61;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index d59b66b9ef..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() { @@ -63,6 +67,7 @@ class SpecialWatchlist extends ChangesListSpecialPage { $this->addHelpLink( 'Help:Watching pages' ); $output->addModuleStyles( [ 'mediawiki.special' ] ); $output->addModules( [ + 'mediawiki.special.recentchanges', 'mediawiki.special.watchlist', ] ); @@ -186,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; }, ], @@ -655,14 +664,15 @@ class SpecialWatchlist extends ChangesListSpecialPage { 'class' => 'namespaceselector', ] ) . "\n"; - $namespaceForm .= '' . Xml::checkLabel( + $hidden = $opts['namespace'] === '' ? ' mw-input-hidden' : ''; + $namespaceForm .= '' . Xml::checkLabel( $this->msg( 'invert' )->text(), 'invert', 'nsinvert', $opts['invert'], [ 'title' => $this->msg( 'tooltip-invert' )->text() ] ) . "\n"; - $namespaceForm .= '' . Xml::checkLabel( + $namespaceForm .= '' . Xml::checkLabel( $this->msg( 'namespace_association' )->text(), 'associated', 'nsassociated',