]> git.mxchange.org Git - friendica.git/commitdiff
Replace "notification" call with new function, removing enotify.php
authorMichael <heluecht@pirati.ca>
Tue, 19 Oct 2021 19:45:36 +0000 (19:45 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 19 Oct 2021 19:45:36 +0000 (19:45 +0000)
composer.json
include/enotify.php [deleted file]
mod/item.php
src/Model/Contact.php
src/Model/Mail.php
src/Module/Register.php
src/Protocol/DFRN.php

index 1a3e841fe286d0b0bc4327af3ea52bce8d050a1e..46f3f3bf3a5796bfb2ee3deeed3ae2505fc60f5c 100644 (file)
@@ -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 (file)
index ee960c8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-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);
-}
index bfb865b790553d3ee293acfc40f117a4beba0652..1309dce47e451e010ed0355a9030525f491de13c 100644 (file)
@@ -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,
index 9aed40cf598b6261028cc7685e5e99fb88f1275d..fc9c11746e992ebc020a97370741e9af19e8703b 100644 (file)
@@ -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),
index 75515c5df53c8166e5d0240ea570a4120f6525cf..f9c197ffa0fa55dd7939fea61c098daa5f4162e6 100644 (file)
@@ -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']]);
                }
index 976e43a5d454b38e42a292c778939a92f9053976..d93c8754feb4a7f89c67017abc37aa6108d6e2b3 100644 (file)
@@ -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'],
index 081b7f2a3748ed29fa8c45a1473abaf533d76495..8c511c2cd5fbe1b1225e3ab04e5501501b8f9a4c 100644 (file)
@@ -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,