X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=6b3171dda6d6cd2102ae9035cbd746201602a79a;hb=87f054a6423109c5037657d529a48bf5eb65d592;hp=bd96ca5d2e80fdc8e084b8b22a45e0afd2d3d0b5;hpb=00035f7ba040b4047fffdaa9ab9e55107ce86139;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index bd96ca5d2e..6b3171dda6 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -465,20 +465,25 @@ function notification($params) if ($show_in_notification_page) { $notification = DI::notify()->insert([ 'name' => $params['source_name'] ?? '', - 'name_cache' => substr(strip_tags(BBCode::convert($params['source_name'] ?? '')), 0, 255), + 'name_cache' => substr(strip_tags(BBCode::convert($params['source_name'])), 0, 255), 'url' => $params['source_link'] ?? '', 'photo' => $params['source_photo'] ?? '', 'link' => $itemlink ?? '', 'uid' => $params['uid'] ?? 0, - 'iid' => $item_id ?? 0, - 'uri-id' => $uri_id ?? 0, - 'parent' => $parent_id ?? 0, - 'parent-uri-id' => $parent_uri_id ?? 0, + 'iid' => $item_id, + 'uri-id' => $uri_id, + 'parent' => $parent_id, + 'parent-uri-id' => $parent_uri_id, 'type' => $params['type'] ?? '', 'verb' => $params['verb'] ?? '', '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); @@ -589,7 +594,7 @@ function check_user_notification($itemid) { * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ function check_item_notification($itemid, $uid, $notification_type) { - $fields = ['id', 'uri-id', 'mention', 'tag', 'parent', 'parent-uri-id', 'title', 'body', + $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];