Adjusting patrol checks for RC and watchlist prefs
authorcenarium <cenarium.sysop@gmail.com>
Tue, 17 Feb 2015 19:55:00 +0000 (20:55 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Wed, 18 Feb 2015 20:17:16 +0000 (20:17 +0000)
This uses the NP patrol check instead of the RC patrol check for the
preference option that allows to hide unpatrolled new pages by default.
And this checks use of RC patrol for the user instead of the config for
the watchlist option (so that users who cannot patrol don't have it).

Bug: T89716
Change-Id: I2895a96f8c21ade83b0174d0d02d1b7e00625737

includes/Preferences.php

index 84d4189..40c3a2b 100644 (file)
@@ -893,6 +893,9 @@ class Preferences {
                                'section' => 'rc/advancedrc',
                                'label-message' => 'tog-hidepatrolled',
                        );
+               }
+
+               if ( $user->useNPPatrol() ) {
                        $defaultPreferences['newpageshidepatrolled'] = array(
                                'type' => 'toggle',
                                'section' => 'rc/advancedrc',
@@ -991,7 +994,7 @@ class Preferences {
                        'label-message' => 'tog-watchlisthideliu',
                );
 
-               if ( $context->getConfig()->get( 'UseRCPatrol' ) ) {
+               if ( $user->useRCPatrol() ) {
                        $defaultPreferences['watchlisthidepatrolled'] = array(
                                'type' => 'toggle',
                                'section' => 'watchlist/advancedwatchlist',