Merge pull request #1071 from MrPetovan/task/9640-rename-notification-classes

[various] Move notification classes
pull/1072/head
Michael Vogel 2021-01-24 15:54:21 +01:00 committed by GitHub
commit 13cdb37f3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -7,11 +7,12 @@
* *
* *
*/ */
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Notify\Type; use Friendica\Model\Notification;
function gnot_install() { function gnot_install() {
@ -79,6 +80,6 @@ function gnot_settings(&$a,&$s) {
function gnot_enotify_mail(&$a,&$b) { function gnot_enotify_mail(&$a,&$b) {
if((! $b['uid']) || (! intval(DI::pConfig()->get($b['uid'], 'gnot','enable')))) if((! $b['uid']) || (! intval(DI::pConfig()->get($b['uid'], 'gnot','enable'))))
return; return;
if($b['type'] == Type::COMMENT) if($b['type'] == Notification\Type::COMMENT)
$b['subject'] = DI::l10n()->t('[Friendica:Notify] Comment to conversation #%d', $b['parent']); $b['subject'] = DI::l10n()->t('[Friendica:Notify] Comment to conversation #%d', $b['parent']);
} }

View File

@ -13,7 +13,7 @@ use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Notify\Type; use Friendica\Model\Notification;
use Friendica\Util\ConfigFileLoader; use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -58,7 +58,7 @@ function public_server_cron($a, $b)
if (DBA::isResult($r)) { if (DBA::isResult($r)) {
foreach ($r as $rr) { foreach ($r as $rr) {
notification([ notification([
'type' => Type::SYSTEM, 'type' => Notification/Type::SYSTEM,
'uid' => $rr['uid'], 'uid' => $rr['uid'],
'system_type' => 'public_server_expire', 'system_type' => 'public_server_expire',
'source_name' => DI::l10n()->t('Administrator'), 'source_name' => DI::l10n()->t('Administrator'),

View File

@ -11,7 +11,7 @@ use Friendica\Core\Hook;
use Friendica\Core\Search; use Friendica\Core\Search;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Notify\Type; use Friendica\Model\Notification;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Util\ConfigFileLoader; use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
@ -58,7 +58,7 @@ function testdrive_cron($a,$b) {
if(count($r)) { if(count($r)) {
foreach($r as $rr) { foreach($r as $rr) {
notification([ notification([
'type' => Type::SYSTEM, 'type' => Notification/Type::SYSTEM,
'uid' => $rr['uid'], 'uid' => $rr['uid'],
'system_type' => 'testdrive_expire', 'system_type' => 'testdrive_expire',
'source_name' => DI::l10n()->t('Administrator'), 'source_name' => DI::l10n()->t('Administrator'),