X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=6b3171dda6d6cd2102ae9035cbd746201602a79a;hb=1a385153f89487113e2aa07a5ceba31914f513c5;hp=81b491ade504562ff5416d2f95ccc0940dede65b;hpb=49db63da2b11ce899639f9c1b53e1f47a456c822;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index 81b491ade5..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);