- $age = $config->get( 'WatchersMaxAge' );
- $threshold = $dbrWatchlist->timestamp( $updated - $age );
- // Number of page watchers who also visited a "recent" edit
- $visitingWatchers = (int)$dbrWatchlist->selectField(
- 'watchlist',
- 'COUNT(*)',
- array(
- 'wl_namespace' => $title->getNamespace(),
- 'wl_title' => $title->getDBkey(),
- 'wl_notificationtimestamp >= ' .
- $dbrWatchlist->addQuotes( $threshold ) .
- ' OR wl_notificationtimestamp IS NULL'
- ),
- $fname
+ $result['visitingWatchers'] = $watchedItemStore->countVisitingWatchers(
+ $title,
+ $updated - $config->get( 'WatchersMaxAge' )