diff --git a/composer.json b/composer.json index 1a3e841fe..46f3f3bf3 100644 --- a/composer.json +++ b/composer.json @@ -85,7 +85,6 @@ "Friendica\\Addon\\": "addon/" }, "files": [ - "include/enotify.php", "boot.php" ] }, diff --git a/include/enotify.php b/include/enotify.php deleted file mode 100644 index ee960c868..000000000 --- a/include/enotify.php +++ /dev/null @@ -1,38 +0,0 @@ -. - * - */ - -use Friendica\DI; - -/** - * Creates a notification entry and possibly sends a mail - * - * @param array $params Array with the elements: - * type, event, otype, activity, verb, uid, cid, item, link, - * source_name, source_mail, source_nick, source_link, source_photo, - * show_in_notification_page - * - * @return bool - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - */ -function notification($params) -{ - return DI::notify()->createFromArray($params); -} diff --git a/mod/item.php b/mod/item.php index bfb865b79..1309dce47 100644 --- a/mod/item.php +++ b/mod/item.php @@ -777,7 +777,7 @@ function item_post(App $a) { // These notifications are sent if someone else is commenting other your wall if ($contact_record != $author) { if ($toplevel_item_id) { - notification([ + DI::notify()->createFromArray([ 'type' => Notification\Type::COMMENT, 'otype' => Notification\ObjectType::ITEM, 'verb' => Activity::POST, @@ -787,7 +787,7 @@ function item_post(App $a) { 'link' => DI::baseUrl() . '/display/' . urlencode($datarray['guid']), ]); } elseif (empty($forum_contact)) { - notification([ + DI::notify()->createFromArray([ 'type' => Notification\Type::WALL, 'otype' => Notification\ObjectType::ITEM, 'verb' => Activity::POST, diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 9aed40cf5..fc9c11746 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2719,7 +2719,7 @@ class Contact if (($user['notify-flags'] & Notification\Type::INTRO) && in_array($user['page-flags'], [User::PAGE_FLAGS_NORMAL])) { - notification([ + DI::notify()->createFromArray([ 'type' => Notification\Type::INTRO, 'otype' => Notification\ObjectType::INTRO, 'verb' => ($sharing ? Activity::FRIEND : Activity::FOLLOW), diff --git a/src/Model/Mail.php b/src/Model/Mail.php index 75515c5df..f9c197ffa 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -104,7 +104,7 @@ class Mail 'link' => DI::baseUrl() . '/message/' . $msg['id'], ]; - notification($notif_params); + DI::notify()->createFromArray($notif_params); Logger::info('Mail is processed, notification was sent.', ['id' => $msg['id'], 'uri' => $msg['uri']]); } diff --git a/src/Module/Register.php b/src/Module/Register.php index 976e43a5d..d93c8754f 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -365,7 +365,7 @@ class Register extends BaseModule // send notification to admins while ($admin = DBA::fetch($admins_stmt)) { - \notification([ + DI::notify()->createFromArray([ 'type' => Model\Notification\Type::SYSTEM, 'event' => 'SYSTEM_REGISTER_REQUEST', 'uid' => $admin['uid'], diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 081b7f2a3..8c511c2cd 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1371,7 +1371,7 @@ class DFRN 'note' => $suggest['body'], 'hash' => $hash, 'datetime' => DateTimeFormat::utcNow(), 'blocked' => false]; DBA::insert('intro', $fields); - notification([ + DI::notify()->createFromArray([ 'type' => Notification\Type::SUGGEST, 'otype' => Notification\ObjectType::INTRO, 'verb' => Activity::REQ_FRIEND, @@ -1576,7 +1576,7 @@ class DFRN $item['parent'] = $parent['id']; // send a notification - notification( + DI::notify()->createFromArray( [ "type" => Notification\Type::POKE, "otype" => Notification\ObjectType::PERSON,