protected function registerFilters() {
parent::registerFilters();
+ $this->registerFilterGroup( new ChangesListStringOptionsFilterGroup( [
+ 'name' => 'watchlistactivity',
+ 'title' => 'rcfilters-filtergroup-watchlistactivity',
+ 'class' => ChangesListStringOptionsFilterGroup::class,
+ 'priority' => 3,
+ 'isFullCoverage' => true,
+ 'filters' => [
+ [
+ 'name' => 'unseen',
+ 'label' => 'rcfilters-filter-watchlistactivity-unseen-label',
+ 'description' => 'rcfilters-filter-watchlistactivity-unseen-description',
+ 'cssClassSuffix' => 'watchedunseen',
+ 'isRowApplicableCallable' => function ( $ctx, $rc ) {
+ $changeTs = $rc->getAttribute( 'rc_timestamp' );
+ $lastVisitTs = $rc->getAttribute( 'wl_notificationtimestamp' );
+ return $changeTs >= $lastVisitTs;
+ },
+ ],
+ [
+ 'name' => 'seen',
+ 'label' => 'rcfilters-filter-watchlistactivity-seen-label',
+ 'description' => 'rcfilters-filter-watchlistactivity-seen-description',
+ 'cssClassSuffix' => 'watchedseen',
+ 'isRowApplicableCallable' => function ( $ctx, $rc ) {
+ $changeTs = $rc->getAttribute( 'rc_timestamp' );
+ $lastVisitTs = $rc->getAttribute( 'wl_notificationtimestamp' );
+ return $changeTs < $lastVisitTs;
+ }
+ ],
+ ],
+ 'default' => ChangesListStringOptionsFilterGroup::NONE,
+ 'queryCallable' => function ( $specialPageClassName, $context, $dbr,
+ &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedValues ) {
+ if ( $selectedValues === [ 'seen' ] ) {
+ $conds[] = 'rc_timestamp < wl_notificationtimestamp';
+ } elseif ( $selectedValues === [ 'unseen' ] ) {
+ $conds[] = 'rc_timestamp >= wl_notificationtimestamp';
+ }
+ }
+ ] ) );
+
$user = $this->getUser();
$significance = $this->getFilterGroup( 'significance' );
"rcfilters-filter-watchlist-watchednew-description": "Changes to Watchlisted pages you haven't visited since the changes occurred.",
"rcfilters-filter-watchlist-notwatched-label": "Not on Watchlist",
"rcfilters-filter-watchlist-notwatched-description": "Everything except changes to your Watchlisted pages.",
+ "rcfilters-filtergroup-watchlistactivity": "Watchlist activity",
+ "rcfilters-filter-watchlistactivity-unseen-label": "Unseen changes",
+ "rcfilters-filter-watchlistactivity-unseen-description": "Changes to pages you haven't visited since the changes occurred.",
+ "rcfilters-filter-watchlistactivity-seen-label": "Seen changes",
+ "rcfilters-filter-watchlistactivity-seen-description": "Changes to pages you have visited since the changes occurred.",
"rcfilters-filtergroup-changetype": "Type of change",
"rcfilters-filter-pageedits-label": "Page edits",
"rcfilters-filter-pageedits-description": "Edits to wiki content, discussions, category descriptions…",
"rcfilters-filter-minor-description": "Description for the filter for showing edits marked as minor.",
"rcfilters-filter-major-label": "Label for the filter for showing edits not marked as minor.",
"rcfilters-filter-major-description": " Description for the filter for showing edits not marked as minor.",
- "rcfilters-filtergroup-watchlist": "Title for the watchlist filter group",
+ "rcfilters-filtergroup-watchlist": "Title for the watchlist filter group (only available on [[Special:Recentchanges]])",
"rcfilters-filter-watchlist-watched-label": "Label for the filter for showing changes to pages on your watchlist.",
"rcfilters-filter-watchlist-watched-description": "Description for the filter for showing changes to pages on your watchlist.",
"rcfilters-filter-watchlist-watchednew-label": "Label for the filter for showing new changes to pages on your watchlist.",
"rcfilters-filter-watchlist-watchednew-description": "Description for the filter for showing new changes to pages on your watchlist.",
"rcfilters-filter-watchlist-notwatched-label": "Label for the filter for showing changes to pages not on your watchlist.",
"rcfilters-filter-watchlist-notwatched-description": "Description for the filter for showing changes to pages not on your watchlist.",
+ "rcfilters-filtergroup-watchlistactivity": "Title for the watchlist activity filter group (only available on [[Special:Watchlist]])",
+ "rcfilters-filter-watchlistactivity-unseen-label": "Label for unseen changes in the watchlist activity filter group.",
+ "rcfilters-filter-watchlistactivity-unseen-description": "Description for unseen changes in the watchlist activity filter group.",
+ "rcfilters-filter-watchlistactivity-seen-label": "Label for seen changes in the watchlist activity filter group.",
+ "rcfilters-filter-watchlistactivity-seen-description": "Description for seen changes in the watchlist activity filter group.",
"rcfilters-filtergroup-changetype": "Title for the filter group for edit type.",
"rcfilters-filter-pageedits-label": "Label for the filter for showing edits to existing pages.",
"rcfilters-filter-pageedits-description": "Description for the filter for showing edits to existing pages.",