mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-14 19:28:31 +00:00
8f44150300
Change-Id: I57b56d285bac4b41e81f656f3c1ddceee4620fb5
27 lines
673 B
PHP
27 lines
673 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Push;
|
|
|
|
use Job;
|
|
use MediaWiki\Extension\Notifications\Services;
|
|
|
|
class NotificationRequestJob extends Job {
|
|
|
|
/**
|
|
* @return bool success
|
|
*/
|
|
public function run(): bool {
|
|
$centralId = $this->params['centralId'];
|
|
$echoServices = Services::getInstance();
|
|
$subscriptionManager = $echoServices->getPushSubscriptionManager();
|
|
$subscriptions = $subscriptionManager->getSubscriptionsForUser( $centralId );
|
|
if ( count( $subscriptions ) === 0 ) {
|
|
return true;
|
|
}
|
|
$serviceClient = $echoServices->getPushNotificationServiceClient();
|
|
$serviceClient->sendCheckEchoRequests( $subscriptions );
|
|
return true;
|
|
}
|
|
|
|
}
|