]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Settings/Account.php
Merge pull request #12562 from MrPetovan/bug/notices
[friendica.git] / src / Module / Settings / Account.php
index d20827e6ab7b669b10dfeb392f7208cd7fd377c8..df8d41519ca7b961ce96c6ff8b28a33fd7805cfb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -38,8 +38,9 @@ use Friendica\Model\Verb;
 use Friendica\Module\BaseSettings;
 use Friendica\Network\HTTPException;
 use Friendica\Protocol\Activity;
+use Friendica\Protocol\Delivery;
+use Friendica\Util\Network;
 use Friendica\Util\Temporal;
-use Friendica\Worker\Delivery;
 
 class Account extends BaseSettings
 {
@@ -67,17 +68,17 @@ class Account extends BaseSettings
                                }
 
                                //  check if the old password was supplied correctly before changing it to the new value
-                               User::getIdFromPasswordAuthentication(local_user(), $request['opassword']);
+                               User::getIdFromPasswordAuthentication(DI::userSession()->getLocalUserId(), $request['opassword']);
 
-                               $result = User::updatePassword(local_user(), $newpass);
+                               $result = User::updatePassword(DI::userSession()->getLocalUserId(), $newpass);
                                if (!DBA::isResult($result)) {
                                        throw new Exception(DI::l10n()->t('Password update failed. Please try again.'));
                                }
 
-                               info(DI::l10n()->t('Password changed.'));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Password changed.'));
                        } catch (Exception $e) {
-                               notice($e->getMessage());
-                               notice(DI::l10n()->t('Password unchanged.'));
+                               DI::sysmsg()->addNotice($e->getMessage());
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Password unchanged.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -102,7 +103,7 @@ class Account extends BaseSettings
                        if ($email != $user['email']) {
                                //  check for the correct password
                                try {
-                                       User::getIdFromPasswordAuthentication(local_user(), $request['mpassword']);
+                                       User::getIdFromPasswordAuthentication(DI::userSession()->getLocalUserId(), $request['mpassword']);
                                } catch (Exception $ex) {
                                        $err .= DI::l10n()->t('Wrong Password.');
                                        $email = $user['email'];
@@ -112,17 +113,14 @@ class Account extends BaseSettings
                                        $err .= DI::l10n()->t('Invalid email.');
                                }
                                //  ensure new email is not the admin mail
-                               if (DI::config()->get('config', 'admin_email')) {
-                                       $adminlist = explode(",", str_replace(" ", "", strtolower(DI::config()->get('config', 'admin_email'))));
-                                       if (in_array(strtolower($email), $adminlist)) {
-                                               $err .= DI::l10n()->t('Cannot change to that email.');
-                                               $email = $user['email'];
-                                       }
+                               if (in_array(strtolower($email), User::getAdminEmailList())) {
+                                       $err .= DI::l10n()->t('Cannot change to that email.');
+                                       $email = $user['email'];
                                }
                        }
 
                        if (strlen($err)) {
-                               notice($err);
+                               DI::sysmsg()->addNotice($err);
                                return;
                        }
 
@@ -144,8 +142,8 @@ class Account extends BaseSettings
                                $fields['openidserver'] = '';
                        }
 
-                       if (!User::update($fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                       if (!User::update($fields, DI::userSession()->getLocalUserId())) {
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        // clear session language
@@ -173,8 +171,8 @@ class Account extends BaseSettings
                        $str_group_deny    = !empty($request['group_deny']) ? $aclFormatter->toString($request['group_deny']) : '';
                        $str_contact_deny  = !empty($request['contact_deny']) ? $aclFormatter->toString($request['contact_deny']) : '';
 
-                       DI::pConfig()->set(local_user(), 'system', 'unlisted', !empty($request['unlisted']));
-                       DI::pConfig()->set(local_user(), 'system', 'accessible-photos', !empty($request['accessible-photos']));
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'unlisted', !empty($request['unlisted']));
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'accessible-photos', !empty($request['accessible-photos']));
 
                        $fields = [
                                'allow_cid'  => $str_contact_allow,
@@ -196,8 +194,8 @@ class Account extends BaseSettings
                                'hide-friends' => $hide_friends
                        ];
 
-                       if (!User::update($fields, local_user()) || !Profile::update($profile_fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                       if (!User::update($fields, DI::userSession()->getLocalUserId()) || !Profile::update($profile_fields, DI::userSession()->getLocalUserId())) {
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -211,13 +209,13 @@ class Account extends BaseSettings
                        $expire_starred      = !empty($request['expire_starred']);
                        $expire_network_only = !empty($request['expire_network_only']);
 
-                       DI::pConfig()->set(local_user(), 'expire', 'items', $expire_items);
-                       DI::pConfig()->set(local_user(), 'expire', 'notes', $expire_notes);
-                       DI::pConfig()->set(local_user(), 'expire', 'starred', $expire_starred);
-                       DI::pConfig()->set(local_user(), 'expire', 'network_only', $expire_network_only);
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'items', $expire_items);
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'notes', $expire_notes);
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'starred', $expire_starred);
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'network_only', $expire_network_only);
 
-                       if (!User::update(['expire' => $expire], local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                       if (!User::update(['expire' => $expire], DI::userSession()->getLocalUserId())) {
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -271,7 +269,7 @@ class Account extends BaseSettings
                        if (!empty($request['notify_activity_participation'])) {
                                $notify_type = $notify_type | UserNotification::TYPE_ACTIVITY_PARTICIPATION;
                        }
-                       DI::pConfig()->set(local_user(), 'system', 'notify_type', $notify_type);
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_type', $notify_type);
 
                        if (!($notify_type & (UserNotification::TYPE_DIRECT_COMMENT + UserNotification::TYPE_DIRECT_THREAD_COMMENT))) {
                                $notify_like     = false;
@@ -279,29 +277,29 @@ class Account extends BaseSettings
                        }
 
                        // Reset like notifications when they are going to be shown again
-                       if (!DI::pConfig()->get(local_user(), 'system', 'notify_like') && $notify_like) {
-                               DI::notification()->setAllSeenForUser(local_user(), ['vid' => Verb::getID(Activity::LIKE)]);
+                       if (!DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_like') && $notify_like) {
+                               DI::notification()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['vid' => Verb::getID(Activity::LIKE)]);
                        }
 
-                       DI::pConfig()->set(local_user(), 'system', 'notify_like', $notify_like);
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_like', $notify_like);
 
                        // Reset share notifications when they are going to be shown again
-                       if (!DI::pConfig()->get(local_user(), 'system', 'notify_announce') && $notify_announce) {
-                               DI::notification()->setAllSeenForUser(local_user(), ['vid' => Verb::getID(Activity::ANNOUNCE)]);
+                       if (!DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_announce') && $notify_announce) {
+                               DI::notification()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['vid' => Verb::getID(Activity::ANNOUNCE)]);
                        }
 
-                       DI::pConfig()->set(local_user(), 'system', 'notify_announce', $notify_announce);
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_announce', $notify_announce);
 
-                       DI::pConfig()->set(local_user(), 'system', 'email_textonly', !empty($request['email_textonly']));
-                       DI::pConfig()->set(local_user(), 'system', 'detailed_notif', !empty($request['detailed_notif']));
-                       DI::pConfig()->set(local_user(), 'system', 'notify_ignored', !empty($request['notify_ignored']));
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'email_textonly', !empty($request['email_textonly']));
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif', !empty($request['detailed_notif']));
+                       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_ignored', !empty($request['notify_ignored']));
 
                        $fields = [
                                'notify-flags' => $notify,
                        ];
 
-                       if (!User::update($fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                       if (!User::update($fields, DI::userSession()->getLocalUserId())) {
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -326,7 +324,7 @@ class Account extends BaseSettings
                        $profile_fields = [];
 
                        if ($account_type == User::ACCOUNT_TYPE_COMMUNITY) {
-                               DI::pConfig()->set(local_user(), 'system', 'unlisted', true);
+                               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'unlisted', true);
 
                                $fields = [
                                        'allow_cid' => '',
@@ -349,8 +347,8 @@ class Account extends BaseSettings
                                'account-type' => $account_type,
                        ]);
 
-                       if (!User::update($fields, local_user()) || !empty($profile_fields) && !Profile::update($profile_fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                       if (!User::update($fields, DI::userSession()->getLocalUserId()) || !empty($profile_fields) && !Profile::update($profile_fields, DI::userSession()->getLocalUserId())) {
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -362,7 +360,7 @@ class Account extends BaseSettings
                                // was there an error
                                if ($_FILES['importcontact-filename']['error'] > 0) {
                                        Logger::notice('Contact CSV file upload error', ['error' => $_FILES['importcontact-filename']['error']]);
-                                       notice(DI::l10n()->t('Contact CSV file upload error'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Contact CSV file upload error'));
                                } else {
                                        $csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name']));
                                        Logger::notice('Import started', ['lines' => count($csvArray)]);
@@ -373,15 +371,15 @@ class Account extends BaseSettings
                                                // or the handle of the account, therefore we check for either
                                                // "http" or "@" to be present in the string.
                                                // All other fields from the row will be ignored
-                                               if ((strpos($csvRow[0], '@') !== false) || in_array(parse_url($csvRow[0], PHP_URL_SCHEME), ['http', 'https'])) {
-                                                       Worker::add(PRIORITY_MEDIUM, 'AddContact', local_user(), $csvRow[0]);
+                                               if ((strpos($csvRow[0], '@') !== false) || Network::isValidHttpUrl($csvRow[0])) {
+                                                       Worker::add(Worker::PRIORITY_MEDIUM, 'AddContact', DI::userSession()->getLocalUserId(), trim($csvRow[0], '@'));
                                                } else {
                                                        Logger::notice('Invalid account', ['url' => $csvRow[0]]);
                                                }
                                        }
                                        Logger::notice('Import done');
 
-                                       info(DI::l10n()->t('Importing Contacts done'));
+                                       DI::sysmsg()->addInfo(DI::l10n()->t('Importing Contacts done'));
                                        // delete temp file
                                        unlink($_FILES['importcontact-filename']['tmp_name']);
                                }
@@ -393,8 +391,8 @@ class Account extends BaseSettings
                }
 
                if (!empty($request['relocate-submit'])) {
-                       Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
-                       info(DI::l10n()->t("Relocate message has been send to your contacts"));
+                       Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, DI::userSession()->getLocalUserId());
+                       DI::sysmsg()->addInfo(DI::l10n()->t("Relocate message has been send to your contacts"));
                        DI::baseUrl()->redirect($redirectUrl);
                }
 
@@ -405,13 +403,13 @@ class Account extends BaseSettings
        {
                parent::content();
 
-               if (!local_user()) {
+               if (!DI::userSession()->getLocalUserId()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
-               $profile = DBA::selectFirst('profile', [], ['uid' => local_user()]);
+               $profile = DBA::selectFirst('profile', [], ['uid' => DI::userSession()->getLocalUserId()]);
                if (!DBA::isResult($profile)) {
-                       notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Unable to find your profile. Please contact your admin.'));
                        return '';
                }
 
@@ -432,10 +430,10 @@ class Account extends BaseSettings
                $unkmail          = $user['unkmail'];
                $cntunkmail       = $user['cntunkmail'];
 
-               $expire_items        = DI::pConfig()->get(local_user(), 'expire', 'items', true);
-               $expire_notes        = DI::pConfig()->get(local_user(), 'expire', 'notes', true);
-               $expire_starred      = DI::pConfig()->get(local_user(), 'expire', 'starred', true);
-               $expire_network_only = DI::pConfig()->get(local_user(), 'expire', 'network_only', false);
+               $expire_items        = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'items', true);
+               $expire_notes        = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'notes', true);
+               $expire_starred      = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'starred', true);
+               $expire_network_only = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'network_only', false);
 
                if (!strlen($user['timezone'])) {
                        $timezone = $a->getTimeZone();
@@ -549,7 +547,7 @@ class Account extends BaseSettings
                /* Installed langs */
                $lang_choices = DI::l10n()->getAvailableLanguages();
 
-               $notify_type = DI::pConfig()->get(local_user(), 'system', 'notify_type');
+               $notify_type = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_type');
 
                $passwordRules = DI::l10n()->t('Allowed characters are a-z, A-Z, 0-9 and special characters except white spaces, accentuated letters and colon (:).')
                        . (PASSWORD_DEFAULT === PASSWORD_BCRYPT ? ' ' . DI::l10n()->t('Password length is limited to 72 characters.') : '');
@@ -561,7 +559,7 @@ class Account extends BaseSettings
 
                        '$submit'              => DI::l10n()->t('Save Settings'),
                        '$baseurl'             => DI::baseUrl()->get(true),
-                       '$uid'                 => local_user(),
+                       '$uid'                 => DI::userSession()->getLocalUserId(),
                        '$form_security_token' => self::getFormSecurityToken('settings'),
                        '$open'                => $this->parameters['open'] ?? 'password',
 
@@ -588,14 +586,14 @@ class Account extends BaseSettings
                        '$profile_in_dir'     => $profile_in_dir,
                        '$profile_in_net_dir' => ['profile_in_netdirectory', DI::l10n()->t('Allow your profile to be searchable globally?'), $profile['net-publish'], DI::l10n()->t("Activate this setting if you want others to easily find and follow you. Your profile will be searchable on remote systems. This setting also determines whether Friendica will inform search engines that your profile should be indexed or not.") . $net_pub_desc],
                        '$hide_friends'       => ['hide-friends', DI::l10n()->t('Hide your contact/friend list from viewers of your profile?'), $profile['hide-friends'], DI::l10n()->t('A list of your contacts is displayed on your profile page. Activate this option to disable the display of your contact list.')],
-                       '$hide_wall'          => ['hidewall', DI::l10n()->t('Hide your profile details from anonymous viewers?'), $user['hidewall'], DI::l10n()->t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.')],
-                       '$unlisted'           => ['unlisted', DI::l10n()->t('Make public posts unlisted'), DI::pConfig()->get(local_user(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community pages or in search results, nor be sent to relay servers. However they can still appear on public feeds on remote servers.')],
-                       '$accessiblephotos'   => ['accessible-photos', DI::l10n()->t('Make all posted pictures accessible'), DI::pConfig()->get(local_user(), 'system', 'accessible-photos'), DI::l10n()->t("This option makes every posted picture accessible via the direct link. This is a workaround for the problem that most other networks can't handle permissions on pictures. Non public pictures still won't be visible for the public on your photo albums though.")],
+                       '$hide_wall'          => ['hidewall', $this->t('Hide your public content from anonymous viewers'), $user['hidewall'], $this->t('Anonymous visitors will only see your basic profile details. Your public posts and replies will still be freely accessible on the remote servers of your followers and through relays.')],
+                       '$unlisted'           => ['unlisted', DI::l10n()->t('Make public posts unlisted'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community pages or in search results, nor be sent to relay servers. However they can still appear on public feeds on remote servers.')],
+                       '$accessiblephotos'   => ['accessible-photos', DI::l10n()->t('Make all posted pictures accessible'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'accessible-photos'), DI::l10n()->t("This option makes every posted picture accessible via the direct link. This is a workaround for the problem that most other networks can't handle permissions on pictures. Non public pictures still won't be visible for the public on your photo albums though.")],
                        '$blockwall'          => ['blockwall', DI::l10n()->t('Allow friends to post to your profile page?'), (intval($user['blockwall']) ? '0' : '1'), DI::l10n()->t('Your contacts may write posts on your profile wall. These posts will be distributed to your contacts')],
                        '$blocktags'          => ['blocktags', DI::l10n()->t('Allow friends to tag your posts?'), (intval($user['blocktags']) ? '0' : '1'), DI::l10n()->t('Your contacts can add additional tags to your posts.')],
                        '$unkmail'            => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.')],
                        '$cntunkmail'         => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail, DI::l10n()->t("(to prevent spam abuse)")],
-                       '$group_select'       => Group::displayGroupSelection(local_user(), $user['def_gid']),
+                       '$group_select'       => Group::displayGroupSelection(DI::userSession()->getLocalUserId(), $user['def_gid']),
                        '$permissions'        => DI::l10n()->t('Default Post Permissions'),
                        '$aclselect'          => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId()),
 
@@ -617,13 +615,12 @@ class Account extends BaseSettings
                        '$notify5' => ['notify5', DI::l10n()->t('You receive a private message'), ($notify & Notification\Type::MAIL), Notification\Type::MAIL, ''],
                        '$notify6' => ['notify6', DI::l10n()->t('You receive a friend suggestion'), ($notify & Notification\Type::SUGGEST), Notification\Type::SUGGEST, ''],
                        '$notify7' => ['notify7', DI::l10n()->t('You are tagged in a post'), ($notify & Notification\Type::TAG_SELF), Notification\Type::TAG_SELF, ''],
-                       '$notify8' => ['notify8', DI::l10n()->t('You are poked/prodded/etc. in a post'), ($notify & Notification\Type::POKE), Notification\Type::POKE, ''],
 
                        '$lbl_notify'                    => DI::l10n()->t('Create a desktop notification when:'),
                        '$notify_tagged'                 => ['notify_tagged', DI::l10n()->t('Someone tagged you'), is_null($notify_type) || $notify_type & UserNotification::TYPE_EXPLICIT_TAGGED, ''],
                        '$notify_direct_comment'         => ['notify_direct_comment', DI::l10n()->t('Someone directly commented on your post'), is_null($notify_type) || $notify_type & (UserNotification::TYPE_IMPLICIT_TAGGED + UserNotification::TYPE_DIRECT_COMMENT + UserNotification::TYPE_DIRECT_THREAD_COMMENT), ''],
-                       '$notify_like'                   => ['notify_like', DI::l10n()->t('Someone liked your content'), DI::pConfig()->get(local_user(), 'system', 'notify_like'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
-                       '$notify_announce'               => ['notify_announce', DI::l10n()->t('Someone shared your content'), DI::pConfig()->get(local_user(), 'system', 'notify_announce'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
+                       '$notify_like'                   => ['notify_like', DI::l10n()->t('Someone liked your content'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_like'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
+                       '$notify_announce'               => ['notify_announce', DI::l10n()->t('Someone shared your content'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_announce'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
                        '$notify_thread_comment'         => ['notify_thread_comment', DI::l10n()->t('Someone commented in your thread'), is_null($notify_type) || $notify_type & UserNotification::TYPE_THREAD_COMMENT, ''],
                        '$notify_comment_participation'  => ['notify_comment_participation', DI::l10n()->t('Someone commented in a thread where you commented'), is_null($notify_type) || $notify_type & UserNotification::TYPE_COMMENT_PARTICIPATION, ''],
                        '$notify_activity_participation' => ['notify_activity_participation', DI::l10n()->t('Someone commented in a thread where you interacted'), is_null($notify_type) || $notify_type & UserNotification::TYPE_ACTIVITY_PARTICIPATION, ''],
@@ -633,19 +630,19 @@ class Account extends BaseSettings
                        '$email_textonly' => [
                                'email_textonly',
                                DI::l10n()->t('Text-only notification emails'),
-                               DI::pConfig()->get(local_user(), 'system', 'email_textonly'),
+                               DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'email_textonly'),
                                DI::l10n()->t('Send text only notification emails, without the html part')
                        ],
                        '$detailed_notif' => [
                                'detailed_notif',
                                DI::l10n()->t('Show detailled notifications'),
-                               DI::pConfig()->get(local_user(), 'system', 'detailed_notif'),
+                               DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif'),
                                DI::l10n()->t('Per default, notifications are condensed to a single notification per item. When enabled every notification is displayed.')
                        ],
                        '$notify_ignored' => [
                                'notify_ignored',
                                DI::l10n()->t('Show notifications of ignored contacts'),
-                               DI::pConfig()->get(local_user(), 'system', 'notify_ignored', true),
+                               DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_ignored', true),
                                DI::l10n()->t("You don't see posts from ignored contacts. But you still see their comments. This setting controls if you want to still receive regular notifications that are caused by ignored contacts or not.")
                        ],