Merge "resourceloader: Fix mw.loader to compute version for current request only"
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 9493663..7b3f25c 100644 (file)
@@ -33,6 +33,8 @@ use Wikimedia\Rdbms\IDatabase;
  */
 class SpecialWatchlist extends ChangesListSpecialPage {
        protected static $savedQueriesPreferenceName = 'rcfilters-wl-saved-queries';
+       protected static $daysPreferenceName = 'watchlistdays';
+       protected static $limitPreferenceName = 'wllimit';
 
        private $maxDays;
 
@@ -108,18 +110,13 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                }
        }
 
-       public function isStructuredFilterUiEnabled() {
-               return $this->getRequest()->getBool( 'rcfilters' ) || (
-                       $this->getConfig()->get( 'StructuredChangeFiltersOnWatchlist' ) &&
-                       $this->getUser()->getOption( 'rcenhancedfilters' )
+       public static function checkStructuredFilterUiEnabled( Config $config, User $user ) {
+               return (
+                       $config->get( 'StructuredChangeFiltersOnWatchlist' ) &&
+                       $user->getOption( 'rcenhancedfilters' )
                );
        }
 
-       public function isStructuredFilterUiEnabledByDefault() {
-               return $this->getConfig()->get( 'StructuredChangeFiltersOnWatchlist' ) &&
-                       $this->getUser()->getDefaultOption( 'rcenhancedfilters' );
-       }
-
        /**
         * Return an array of subpages that this special page will accept.
         *
@@ -489,7 +486,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                $output = $this->getOutput();
 
                # Show a message about replica DB lag, if applicable
-               $lag = wfGetLB()->safeGetLag( $dbr );
+               $lag = MediaWikiServices::getInstance()->getDBLoadBalancer()->safeGetLag( $dbr );
                if ( $lag > 0 ) {
                        $output->showLagWarning( $lag );
                }
@@ -877,12 +874,4 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                $count = $store->countWatchedItems( $this->getUser() );
                return floor( $count / 2 );
        }
-
-       function getDefaultLimit() {
-               return $this->getUser()->getIntOption( 'wllimit' );
-       }
-
-       function getDefaultDays() {
-               return floatval( $this->getUser()->getOption( 'watchlistdays' ) );
-       }
 }