X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FSubscription.php;h=cb14ae2b5f8939779e1059b23abf6783b4a6ef0a;hb=624e4c192c7f837ac0587a50da6e1409081eb519;hp=f9498af986a5b5fb2205c84b76bc8c3c5d2968b3;hpb=3e6fea30f2f3bc2352b6e16e1d48e204cde3696b;p=friendica.git diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index f9498af986..cb14ae2b5f 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -1,6 +1,6 @@ $nid]); + $type = \Friendica\Factory\Api\Mastodon\Notification::getType($Notification); - $type = Notification::getType($notification); - $desktop_notification = !in_array($type, [Notification::TYPE_RESHARE, Notification::TYPE_LIKE]); - - - if (DI::pConfig()->get($notification['uid'], 'system', 'notify_like') && ($type == 'favourite')) { - $desktop_notification = true; - } - - if (DI::pConfig()->get($notification['uid'], 'system', 'notify_announce') && ($type == 'reblog')) { - $desktop_notification = true; - } - - if ($desktop_notification) { - notification_from_array($notification); + if (DI::notify()->NotifyOnDesktop($Notification, $type)) { + DI::notify()->createFromNotification($Notification); } if (empty($type)) { return; } - $subscriptions = DBA::select('subscription', [], ['uid' => $notification['uid'], $type => true]); + $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'], $nid); + Worker::add(PRIORITY_HIGH, 'PushSubscription', $subscription['id'], $Notification->id); } DBA::close($subscriptions); }