Merge "Allow wikilinks in "show/hide <type of change>" labels on Watchlist and Recent...
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index bdca301..32204f8 100644 (file)
@@ -33,6 +33,8 @@ use Wikimedia\Rdbms\FakeResultWrapper;
 class SpecialRecentChanges extends ChangesListSpecialPage {
 
        protected static $savedQueriesPreferenceName = 'rcfilters-saved-queries';
+       protected static $daysPreferenceName = 'rcdays'; // Use general RecentChanges preference
+       protected static $limitPreferenceName = 'rcfilters-limit'; // Use RCFilters-specific preference
 
        private $watchlistFilterGroupDefinition;
 
@@ -974,11 +976,14 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                return 60 * 5;
        }
 
-       function getDefaultLimit() {
-               return $this->getUser()->getIntOption( 'rclimit' );
-       }
+       public function getDefaultLimit() {
+               $systemPrefValue = $this->getUser()->getIntOption( 'rclimit' );
+               // Prefer the RCFilters-specific preference if RCFilters is enabled
+               if ( $this->isStructuredFilterUiEnabled() ) {
+                       return $this->getUser()->getIntOption( static::$limitPreferenceName, $systemPrefValue );
+               }
 
-       function getDefaultDays() {
-               return floatval( $this->getUser()->getOption( 'rcdays' ) );
+               // Otherwise, use the system rclimit preference value
+               return $systemPrefValue;
        }
 }