],
],
],
+
+ [
+ 'name' => 'watchlist',
+ 'title' => 'rcfilters-filtergroup-watchlist',
+ 'class' => ChangesListStringOptionsFilterGroup::class,
+ 'isFullCoverage' => true,
+ 'filters' => [
+ [
+ 'name' => 'watched',
+ 'label' => 'rcfilters-filter-watchlist-watched-label',
+ 'description' => 'rcfilters-filter-watchlist-watched-description',
+ 'cssClassSuffix' => 'watched',
+ 'isRowApplicableCallable' => function ( $ctx, $rc ) {
+ return $rc->getAttribute( 'wl_user' );
+ }
+ ],
+ [
+ 'name' => 'watchednew',
+ 'label' => 'rcfilters-filter-watchlist-watchednew-label',
+ 'description' => 'rcfilters-filter-watchlist-watchednew-description',
+ 'cssClassSuffix' => 'watchednew',
+ 'isRowApplicableCallable' => function ( $ctx, $rc ) {
+ return $rc->getAttribute( 'wl_user' ) &&
+ $rc->getAttribute( 'rc_timestamp' ) > $rc->getAttribute( 'wl_notificationtimestamp' );
+ },
+ ],
+ [
+ 'name' => 'notwatched',
+ 'label' => 'rcfilters-filter-watchlist-notwatched-label',
+ 'description' => 'rcfilters-filter-watchlist-notwatched-description',
+ 'cssClassSuffix' => 'notwatched',
+ 'isRowApplicableCallable' => function ( $ctx, $rc ) {
+ return $rc->getAttribute( 'wl_user' ) === null;
+ },
+ ]
+ ],
+ 'default' => ChangesListStringOptionsFilterGroup::NONE,
+ 'queryCallable' => function ( $specialPageClassName, $context, $dbr,
+ &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedValues ) {
+ sort( $selectedValues );
+ $notwatchedCond = 'wl_user IS NULL';
+ $watchedCond = 'wl_user IS NOT NULL';
+ $newCond = 'rc_timestamp >= wl_notificationtimestamp';
+
+ if ( $selectedValues === [ 'notwatched' ] ) {
+ $conds[] = $notwatchedCond;
+ return;
+ }
+
+ if ( $selectedValues === [ 'watched' ] ) {
+ $conds[] = $watchedCond;
+ return;
+ }
+
+ if ( $selectedValues === [ 'watchednew' ] ) {
+ $conds[] = $dbr->makeList( [
+ $watchedCond,
+ $newCond
+ ], LIST_AND );
+ return;
+ }
+
+ if ( $selectedValues === [ 'notwatched', 'watched' ] ) {
+ // no filters
+ return;
+ }
+
+ if ( $selectedValues === [ 'notwatched', 'watchednew' ] ) {
+ $conds[] = $dbr->makeList( [
+ $notwatchedCond,
+ $dbr->makeList( [
+ $watchedCond,
+ $newCond
+ ], LIST_AND )
+ ], LIST_OR );
+ return;
+ }
+
+ if ( $selectedValues === [ 'watched', 'watchednew' ] ) {
+ $conds[] = $watchedCond;
+ return;
+ }
+
+ if ( $selectedValues === [ 'notwatched', 'watched', 'watchednew' ] ) {
+ // no filters
+ return;
+ }
+ },
+ ],
];
$this->reviewStatusFilterGroupDefinition = [
'rcfilters-hideminor-conflicts-typeofchange',
'rcfilters-typeofchange-conflicts-hideminor'
);
+
+ $watchlistGroup = $this->getFilterGroup( 'watchlist' );
+ $watchlistGroup->getFilter( 'watched' )->setAsSupersetOf(
+ $watchlistGroup->getFilter( 'watchednew' )
+ );
}
/**
"rcfilters-filter-minor-description": "Edits the author labeled as minor.",
"rcfilters-filter-major-label": "Non-minor edits",
"rcfilters-filter-major-description": "Edits not labeled as minor.",
+ "rcfilters-filtergroup-watchlist": "Watchlisted pages",
+ "rcfilters-filter-watchlist-watched-label": "On Watchlist",
+ "rcfilters-filter-watchlist-watched-description": "Changes to pages on your Watchlist.",
+ "rcfilters-filter-watchlist-watchednew-label": "New Watchlist changes",
+ "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-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-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-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.",