Rearrange the notification settings
This commit is contained in:
parent
e5802b7c30
commit
da33517a2d
4 changed files with 157 additions and 149 deletions
|
|
@ -253,20 +253,6 @@ class Account extends BaseSettings
|
|||
$notify_like = !empty($request['notify_like']);
|
||||
$notify_announce = !empty($request['notify_announce']);
|
||||
|
||||
// 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)]);
|
||||
}
|
||||
|
||||
DI::pConfig()->set(local_user(), '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)]);
|
||||
}
|
||||
|
||||
DI::pConfig()->set(local_user(), 'system', 'notify_announce', $notify_announce);
|
||||
|
||||
$notify_type = 0;
|
||||
|
||||
if (!empty($request['notify_tagged'])) {
|
||||
|
|
@ -286,6 +272,25 @@ class Account extends BaseSettings
|
|||
}
|
||||
DI::pConfig()->set(local_user(), 'system', 'notify_type', $notify_type);
|
||||
|
||||
if (!($notify_type & 72)) {
|
||||
$notify_like = false;
|
||||
$notify_announce = false;
|
||||
}
|
||||
|
||||
// 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)]);
|
||||
}
|
||||
|
||||
DI::pConfig()->set(local_user(), '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)]);
|
||||
}
|
||||
|
||||
DI::pConfig()->set(local_user(), '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']));
|
||||
|
|
@ -610,12 +615,11 @@ class Account extends BaseSettings
|
|||
'$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_like' => ['notify_like', DI::l10n()->t('Someone liked your content'), DI::pConfig()->get(local_user(), 'system', 'notify_like'), ''],
|
||||
'$notify_announce' => ['notify_announce', DI::l10n()->t('Someone shared your content'), DI::pConfig()->get(local_user(), 'system', 'notify_announce'), ''],
|
||||
|
||||
'$lbl_notify' => DI::l10n()->t('Create a desktop notification when:'),
|
||||
'$notify_tagged' => ['notify_tagged', DI::l10n()->t('Someone tagged you'), $notify_type & 3, ''],
|
||||
'$notify_direct_comment' => ['notify_direct_comment', DI::l10n()->t('Someone directly commented on your post'), $notify_type & 72, ''],
|
||||
'$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_thread_comment' => ['notify_thread_comment', DI::l10n()->t('Someone commented on your thread'), $notify_type & 4, ''],
|
||||
'$notify_comment_participation' => ['notify_comment_participation', DI::l10n()->t('Someone commented in a thread where you commented'), $notify_type & 16, ''],
|
||||
'$notify_activity_participation' => ['notify_activity_participation', DI::l10n()->t('Someone commented on a thread where you interacted'), $notify_type & 32, ''],
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: 2022.05-rc\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-06-05 18:14+0000\n"
|
||||
"POT-Creation-Date: 2022-06-05 21:17+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -139,7 +139,7 @@ msgstr ""
|
|||
#: src/Module/Register.php:77 src/Module/Register.php:90
|
||||
#: src/Module/Register.php:206 src/Module/Register.php:245
|
||||
#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:48
|
||||
#: src/Module/Settings/Account.php:403 src/Module/Settings/Delegation.php:42
|
||||
#: src/Module/Settings/Account.php:408 src/Module/Settings/Delegation.php:42
|
||||
#: src/Module/Settings/Delegation.php:70 src/Module/Settings/Display.php:42
|
||||
#: src/Module/Settings/Display.php:120
|
||||
#: src/Module/Settings/Profile/Photo/Crop.php:166
|
||||
|
|
@ -1204,7 +1204,7 @@ msgstr ""
|
|||
#: mod/settings.php:352 src/Module/Admin/Addons/Index.php:69
|
||||
#: src/Module/Admin/Features.php:87 src/Module/Admin/Logs/Settings.php:81
|
||||
#: src/Module/Admin/Site.php:434 src/Module/Admin/Themes/Index.php:113
|
||||
#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:553
|
||||
#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:558
|
||||
#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:193
|
||||
msgid "Save Settings"
|
||||
msgstr ""
|
||||
|
|
@ -2783,7 +2783,7 @@ msgstr ""
|
|||
msgid "News"
|
||||
msgstr ""
|
||||
|
||||
#: src/Content/Widget.php:525 src/Module/Settings/Account.php:449
|
||||
#: src/Content/Widget.php:525 src/Module/Settings/Account.php:454
|
||||
msgid "Account Types"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -4373,19 +4373,19 @@ msgstr ""
|
|||
msgid "List of pending user deletions"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:100 src/Module/Settings/Account.php:487
|
||||
#: src/Module/Admin/BaseUsers.php:100 src/Module/Settings/Account.php:492
|
||||
msgid "Normal Account Page"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:494
|
||||
#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:499
|
||||
msgid "Soapbox Page"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:501
|
||||
#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:506
|
||||
msgid "Public Forum"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:508
|
||||
#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:513
|
||||
msgid "Automatic Friend Page"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -4393,19 +4393,19 @@ msgstr ""
|
|||
msgid "Private Forum"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:107 src/Module/Settings/Account.php:459
|
||||
#: src/Module/Admin/BaseUsers.php:107 src/Module/Settings/Account.php:464
|
||||
msgid "Personal Page"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:466
|
||||
#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:471
|
||||
msgid "Organisation Page"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:473
|
||||
#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:478
|
||||
msgid "News Page"
|
||||
msgstr ""
|
||||
|
||||
#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:480
|
||||
#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:485
|
||||
msgid "Community Forum"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -5801,7 +5801,7 @@ msgstr ""
|
|||
|
||||
#: src/Module/Admin/Site.php:530
|
||||
msgid ""
|
||||
"W:5 | ||||