From 511556085a90f3bd12c4bc4d5b482a12d5fd2b98 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 4 Feb 2020 22:23:37 +0100 Subject: [PATCH] Move Notify::TYPE_SYSTEM --- boot.php | 11 ----------- include/enotify.php | 4 ++-- src/Model/Notify/Type.php | 5 ++++- src/Module/Register.php | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/boot.php b/boot.php index df7dc85608..40729a78c0 100644 --- a/boot.php +++ b/boot.php @@ -134,17 +134,6 @@ $netgroup_ids = [ */ define('MAX_LIKERS', 75); -/** - * @name Notify - * - * Email notification options - * @{ - */ - -define('NOTIFY_SYSTEM', 32768); -/* @}*/ - - /** @deprecated since 2019.03, use Term::UNKNOWN instead */ define('TERM_UNKNOWN', Term::UNKNOWN); /** @deprecated since 2019.03, use Term::HASHTAG instead */ diff --git a/include/enotify.php b/include/enotify.php index 6d261720e5..96630ca3ec 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -375,7 +375,7 @@ function notification($params) } } - if ($params['type'] == NOTIFY_SYSTEM) { + if ($params['type'] == Notify\Type::SYSTEM) { switch($params['event']) { case "SYSTEM_REGISTER_REQUEST": $itemlink = $params['link']; @@ -456,7 +456,7 @@ function notification($params) // send email notification if notification preferences permit if ((intval($params['notify_flags']) & intval($params['type'])) - || $params['type'] == NOTIFY_SYSTEM) { + || $params['type'] == Notify\Type::SYSTEM) { Logger::log('sending notification email'); diff --git a/src/Model/Notify/Type.php b/src/Model/Notify/Type.php index f15c1b76a7..aae5fedc05 100644 --- a/src/Model/Notify/Type.php +++ b/src/Model/Notify/Type.php @@ -8,7 +8,7 @@ namespace Friendica\Model\Notify; class Type { /** @var int Notification about a introduction */ - const INTRO = 1; + const INTRO = 1; /** @var int Notification about a confirmed introduction */ const CONFIRM = 2; /** @var int Notification about a post on your wall */ @@ -33,4 +33,7 @@ class Type const POKE = 512; /** @var int Notification about either a contact had posted something directly or the contact is a mentioned forum */ const SHARE = 1024; + + /** @var int Global System notifications */ + const SYSTEM = 32768; } diff --git a/src/Module/Register.php b/src/Module/Register.php index 98af06543d..8401a215a8 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -348,7 +348,7 @@ class Register extends BaseModule // send notification to admins while ($admin = DBA::fetch($admins_stmt)) { \notification([ - 'type' => NOTIFY_SYSTEM, + 'type' => Model\Notify\Type::SYSTEM, 'event' => 'SYSTEM_REGISTER_REQUEST', 'source_name' => $user['username'], 'source_mail' => $user['email'], -- 2.39.5