mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-04 20:28:49 +00:00
c76761eff3
Bug: T305667 Change-Id: I5a7846a0fc383bddbf6511d6ba73c8be7d7760c7
27 lines
647 B
PHP
27 lines
647 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Push;
|
|
|
|
use EchoServices;
|
|
use Job;
|
|
|
|
class NotificationRequestJob extends Job {
|
|
|
|
/**
|
|
* @return bool success
|
|
*/
|
|
public function run(): bool {
|
|
$centralId = $this->params['centralId'];
|
|
$echoServices = EchoServices::getInstance();
|
|
$subscriptionManager = $echoServices->getPushSubscriptionManager();
|
|
$subscriptions = $subscriptionManager->getSubscriptionsForUser( $centralId );
|
|
if ( count( $subscriptions ) === 0 ) {
|
|
return true;
|
|
}
|
|
$serviceClient = $echoServices->getPushNotificationServiceClient();
|
|
$serviceClient->sendCheckEchoRequests( $subscriptions );
|
|
return true;
|
|
}
|
|
|
|
}
|