]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Subscription.php
Changed to null-coalscing style (??) as sugguested by @MrPetovan
[friendica.git] / src / Model / Subscription.php
index c6c57c732835da504b97cb9c6f95215636456b5a..cb14ae2b5f8939779e1059b23abf6783b4a6ef0a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -143,18 +143,8 @@ class Subscription
        {
                $type = \Friendica\Factory\Api\Mastodon\Notification::getType($Notification);
 
-               $desktop_notification = !in_array($type, [Notification::TYPE_RESHARE, Notification::TYPE_LIKE]);
-
-               if (DI::pConfig()->get($Notification->uid, 'system', 'notify_like') && ($type == Notification::TYPE_LIKE)) {
-                       $desktop_notification = true;
-               }
-
-               if (DI::pConfig()->get($Notification->uid, 'system', 'notify_announce') && ($type == Notification::TYPE_RESHARE)) {
-                       $desktop_notification = true;
-               }
-
-               if ($desktop_notification) {
-                       notification_from_array($Notification);
+               if (DI::notify()->NotifyOnDesktop($Notification, $type)) {
+                       DI::notify()->createFromNotification($Notification);
                }
 
                if (empty($type)) {