mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 08:15:35 +00:00
657e914513
Change-Id: Ica8e5c0496171dba4315c27072c2d865eb747e78
27 lines
617 B
PHP
27 lines
617 B
PHP
<?php
|
|
|
|
namespace EchoPush;
|
|
|
|
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;
|
|
}
|
|
|
|
}
|