X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=58cde7e55ab8ed562bc004520a3a96939615c35f;hb=4e618302d9e7b96c008d3dfa3c0554cff52d5222;hp=27e58295600927637210c87b187f95a00fda77d4;hpb=b5906606e1aa1a795231fb813b766818b1dd6c25;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 27e5829560..58cde7e55a 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -21,6 +21,8 @@ * @ingroup SpecialPage */ +use MediaWiki\MediaWikiServices; + /** * A special page that lists last changes made to the wiki, * limited to user-defined list of titles. @@ -365,14 +367,25 @@ class SpecialWatchlist extends ChangesListSpecialPage { if ( $this->getConfig()->get( 'RCShowWatchingUsers' ) && $user->getOption( 'shownumberswatching' ) ) { - $watchedItemStore = WatchedItemStore::getDefaultInstance(); + $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore(); } $s = $list->beginRecentChangesList(); + $userShowHiddenCats = $this->getUser()->getBoolOption( 'showhiddencats' ); $counter = 1; foreach ( $rows as $obj ) { # Make RC entry $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++; if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) ) { @@ -635,7 +648,8 @@ class SpecialWatchlist extends ChangesListSpecialPage { * @return int */ protected function countItems() { - $count = WatchedItemStore::getDefaultInstance()->countWatchedItems( $this->getUser() ); + $store = MediaWikiServices::getInstance()->getWatchedItemStore(); + $count = $store->countWatchedItems( $this->getUser() ); return floor( $count / 2 ); } }