IT translation update jrynn addon THX Sylke Vicious
[friendica-addons.git/.git] / public_server / public_server.php
index 549020b..482a8a0 100644 (file)
@@ -13,7 +13,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\DI;
-use Friendica\Model\Notify\Type;
+use Friendica\Model\Notification;
 use Friendica\Util\ConfigFileLoader;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Strings;
@@ -58,12 +58,9 @@ function public_server_cron($a, $b)
        if (DBA::isResult($r)) {
                foreach ($r as $rr) {
                        notification([
+                               'type' => Notification\Type::SYSTEM,
                                'uid' => $rr['uid'],
-                               'type' => Type::SYSTEM,
                                'system_type' => 'public_server_expire',
-                               'language'     => $rr['language'],
-                               'to_name'      => $rr['username'],
-                               'to_email'     => $rr['email'],
                                'source_name'  => DI::l10n()->t('Administrator'),
                                'source_link'  => DI::baseUrl()->get(),
                                'source_photo' => DI::baseUrl()->get() . '/images/person-80.jpg',
@@ -115,7 +112,7 @@ function public_server_cron($a, $b)
 
 function public_server_enotify(&$a, &$b)
 {
-       if (!empty($b['params']) && $b['params']['type'] == Type::SYSTEM
+       if (!empty($b['params']) && $b['params']['type'] == Notification\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'));