/** * Find which communities contain revisions from the given users and batch * tasks to revert those revisions * * This task should only run from community.wikia.com, where the UserRollback * extension is enabled. * * @param array $users list of user names or IPs whose revisions should be reverted * @param int $timestamp Unix time after which revisions should be reverted * @param string $queue */ public function enqueueRollback(array $identifiers, $timestamp, $queue) { $affectedWikis = $this->getAffectedWikis($identifiers); $taskLists = []; foreach ($affectedWikis as $wikiId => $usersOnWiki) { $task = new UserRollbackTask(); $taskLists[] = (new AsyncTaskList())->wikiId($wikiId)->setPriority($queue)->add($task->call('doRollback', $usersOnWiki, $timestamp)); } $result = []; if (!empty($taskLists)) { $result = AsyncTaskList::batch($taskLists); } return $result; }