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() {
$this->addHelpLink( 'Help:Watching pages' );
$output->addModuleStyles( [ 'mediawiki.special' ] );
$output->addModules( [
+ 'mediawiki.special.recentchanges',
'mediawiki.special.watchlist',
] );
'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;
},
],
$join_conds = array_merge(
[
'watchlist' => [
- 'INNER JOIN',
+ 'JOIN',
[
'wl_user' => $user->getId(),
'wl_namespace=rc_namespace',
$services = MediaWikiServices::getInstance();
# Show a message about replica DB lag, if applicable
- $lag = $services->getDBLoadBalancer()->safeGetLag( $dbr );
+ $lag = $dbr->getSessionLagStatus()['lag'];
if ( $lag > 0 ) {
$output->showLagWarning( $lag );
}
'class' => 'namespaceselector',
]
) . "\n";
- $namespaceForm .= '<span class="mw-input-with-label">' . Xml::checkLabel(
+ $hidden = $opts['namespace'] === '' ? ' mw-input-hidden' : '';
+ $namespaceForm .= '<span class="mw-input-with-label' . $hidden . '">' . Xml::checkLabel(
$this->msg( 'invert' )->text(),
'invert',
'nsinvert',
$opts['invert'],
[ 'title' => $this->msg( 'tooltip-invert' )->text() ]
) . "</span>\n";
- $namespaceForm .= '<span class="mw-input-with-label">' . Xml::checkLabel(
+ $namespaceForm .= '<span class="mw-input-with-label' . $hidden . '">' . Xml::checkLabel(
$this->msg( 'namespace_association' )->text(),
'associated',
'nsassociated',