]> git.mxchange.org Git - friendica.git/blobdiff - include/enotify.php
Merge pull request #1 from friendica/develop
[friendica.git] / include / enotify.php
index 89a81833d08308bfea5ed3303f6a9f2fac242118..732c1d7b43c18e401f5cb31c494b3689780ec2a6 100644 (file)
@@ -479,6 +479,11 @@ function notification($params)
                        'otype'         => $params['otype'] ?? '',
                ]);
 
+               // Notification insertion can be intercepted by an addon registering the 'enotify_store' hook
+               if (!$notification) {
+                       return false;
+               }
+
                $notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]);
 
                DI::notify()->update($notification);
@@ -592,7 +597,7 @@ function check_item_notification($itemid, $uid, $notification_type) {
        $fields = ['id', 'uri-id', 'mention', 'parent', 'parent-uri-id', 'title', 'body',
                'author-link', 'author-name', 'author-avatar', 'author-id',
                'guid', 'parent-uri', 'uri', 'contact-id', 'network'];
-       $condition = ['id' => $itemid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'deleted' => false];
+       $condition = ['id' => $itemid, 'deleted' => false];
        $item = Item::selectFirstForUser($uid, $fields, $condition);
        if (!DBA::isResult($item)) {
                return false;