From 4e9838f5717f789c650a1109574189e23fdf88da Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 4 Feb 2020 22:08:59 +0100 Subject: [PATCH 1/2] Move Notify::TYPE_COMMENT --- gnot/gnot.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnot/gnot.php b/gnot/gnot.php index 686b1f65..26012c44 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -11,6 +11,7 @@ use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; +use Friendica\Model\Notify\Type; function gnot_install() { @@ -92,6 +93,6 @@ function gnot_settings(&$a,&$s) { function gnot_enotify_mail(&$a,&$b) { if((! $b['uid']) || (! intval(DI::pConfig()->get($b['uid'], 'gnot','enable')))) return; - if($b['type'] == NOTIFY_COMMENT) + if($b['type'] == Type::COMMENT) $b['subject'] = DI::l10n()->t('[Friendica:Notify] Comment to conversation #%d', $b['parent']); } -- 2.43.5 From 6cc04a3ebc61303c88622aeb235b2deb5d33f855 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 4 Feb 2020 22:23:37 +0100 Subject: [PATCH 2/2] Move Notify::TYPE_SYSTEM --- public_server/public_server.php | 5 +++-- testdrive/testdrive.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public_server/public_server.php b/public_server/public_server.php index 04500188..a02c8672 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -13,6 +13,7 @@ use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Notify\Type; use Friendica\Util\ConfigFileLoader; use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; @@ -67,7 +68,7 @@ function public_server_cron($a, $b) foreach ($r as $rr) { notification([ 'uid' => $rr['uid'], - 'type' => NOTIFY_SYSTEM, + 'type' => Type::SYSTEM, 'system_type' => 'public_server_expire', 'language' => $rr['language'], 'to_name' => $rr['username'], @@ -123,7 +124,7 @@ function public_server_cron($a, $b) function public_server_enotify(&$a, &$b) { - if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM + if (!empty($b['params']) && $b['params']['type'] == Type::SYSTEM && !empty($b['params']['system_type']) && $b['params']['system_type'] === 'public_server_expire') { $b['itemlink'] = DI::baseUrl()->get(); $b['epreamble'] = $b['preamble'] = DI::l10n()->t('Your account on %s will expire in a few days.', DI::config()->get('system', 'sitename')); diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index 1732c6a9..cb95babf 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -11,6 +11,7 @@ use Friendica\Core\Hook; use Friendica\Core\Search; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Notify\Type; use Friendica\Model\User; use Friendica\Util\ConfigFileLoader; use Friendica\Util\DateTimeFormat; @@ -69,7 +70,7 @@ function testdrive_cron($a,$b) { foreach($r as $rr) { notification([ 'uid' => $rr['uid'], - 'type' => NOTIFY_SYSTEM, + 'type' => Type::SYSTEM, 'system_type' => 'testdrive_expire', 'language' => $rr['language'], 'to_name' => $rr['username'], @@ -96,7 +97,7 @@ function testdrive_cron($a,$b) { } function testdrive_enotify(&$a, &$b) { - if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM + if (!empty($b['params']) && $b['params']['type'] == Type::SYSTEM && !empty($b['params']['system_type']) && $b['params']['system_type'] === 'testdrive_expire') { $b['itemlink'] = DI::baseUrl()->get(); $b['epreamble'] = $b['preamble'] = DI::l10n()->t('Your account on %s will expire in a few days.', DI::config()->get('system', 'sitename')); -- 2.43.5