X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FSubscription.php;h=88aa820674007a73eedb3228c8ef5e412b0edc25;hb=8e397b5849136b4acee2f67aeb10be0ecb8335af;hp=e5305378e35945f8148efd160ae659b81d49ec44;hpb=c6c936a80ff947ae77a90ad910c8dc03e10f6dbd;p=friendica.git diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index e5305378e3..88aa820674 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -25,6 +25,7 @@ use Friendica\Core\Logger; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Factory\Api\Mastodon\Notification as NotificationFactory; use Friendica\Navigation\Notifications\Entity; use Friendica\Object\Api\Mastodon\Notification; use Minishlink\WebPush\VAPID; @@ -133,14 +134,14 @@ class Subscription /** * Prepare push notification * - * @param Notification $Notification Notification instance + * @param Notification $Notification * @return void */ public static function pushByNotification(Entity\Notification $notification) { - $type = \Friendica\Factory\Api\Mastodon\Notification::getType($notification); + $type = NotificationFactory::getType($notification); - if (DI::notify()->NotifyOnDesktop($notification, $type)) { + if (DI::notify()->shouldShowOnDesktop($notification, $type)) { DI::notify()->createFromNotification($notification); } @@ -151,7 +152,7 @@ class Subscription $subscriptions = DBA::select('subscription', [], ['uid' => $notification->uid, $type => true]); while ($subscription = DBA::fetch($subscriptions)) { Logger::info('Push notification', ['id' => $subscription['id'], 'uid' => $subscription['uid'], 'type' => $type]); - Worker::add(PRIORITY_HIGH, 'PushSubscription', $subscription['id'], $notification->id); + Worker::add(Worker::PRIORITY_HIGH, 'PushSubscription', $subscription['id'], $notification->id); } DBA::close($subscriptions); }