params['userIds'] ) > 1 ) { // If there are multiple users, queue a single job for each one $jobs = []; foreach ( $this->params['userIds'] as $userId ) { $jobs[] = new NotificationDeleteJob( $this->title, [ 'userIds' => [ $userId ] ] ); } MediaWikiServices::getInstance()->getJobQueueGroup()->push( $jobs ); return true; } $notifMapper = new NotificationMapper(); // Back-compat for older jobs which used [ $userId => $userId ]; $userIds = array_values( $this->params['userIds'] ); $userId = $userIds[0]; $user = User::newFromId( $userId ); $notif = $notifMapper->fetchByUserOffset( $user, $wgEchoMaxUpdateCount ); if ( $notif ) { $notifMapper->deleteByUserEventOffset( $user, $notif->getEvent()->getId() ); $notifUser = NotifUser::newFromUser( $user ); $notifUser->resetNotificationCount(); } return true; } }