Merge "Hide hiddencat catwatch changes in special changelists"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index 8e52f14..b93fb4e 100644 (file)
@@ -355,14 +355,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                        if ( $showWatcherCount && $obj->rc_namespace >= 0 ) {
                                if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) {
                                        $watcherCache[$obj->rc_namespace][$obj->rc_title] =
-                                               $dbr->selectField(
-                                                       'watchlist',
-                                                       'COUNT(*)',
-                                                       [
-                                                               'wl_namespace' => $obj->rc_namespace,
-                                                               'wl_title' => $obj->rc_title,
-                                                       ],
-                                                       __METHOD__ . '-watchers'
+                                               WatchedItemStore::getDefaultInstance()->countWatchers(
+                                                       new TitleValue( (int)$obj->rc_namespace, $obj->rc_title )
                                                );
                                }
                                $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];