Merge "Hide hiddencat catwatch changes in special changelists"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index 8398989..b93fb4e 100644 (file)
@@ -324,12 +324,23 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                $list = ChangesList::newFromContext( $this->getContext() );
                $list->initChangesListRows( $rows );
 
+               $userShowHiddenCats = $this->getUser()->getBoolOption( 'showhiddencats' );
                $rclistOutput = $list->beginRecentChangesList();
                foreach ( $rows as $obj ) {
                        if ( $limit == 0 ) {
                                break;
                        }
                        $rc = RecentChange::newFromRow( $obj );
+
+                       # Skip CatWatch entries for hidden cats based on user preference
+                       if (
+                               $rc->getAttribute( 'rc_type' ) == RC_CATEGORIZE &&
+                               !$userShowHiddenCats &&
+                               $rc->getParam( 'hidden-cat' )
+                       ) {
+                               continue;
+                       }
+
                        $rc->counter = $counter++;
                        # Check if the page has been updated since the last visit
                        if ( $this->getConfig()->get( 'ShowUpdatedMarker' )