From 665aa4a2268e3455bbf921aede973d4e2b54eb47 Mon Sep 17 00:00:00 2001 From: Sergey Mosin Date: Sun, 2 Jul 2023 22:14:28 -0400 Subject: [PATCH 1/5] add 'msg_default_action' to admin settings ('defaults' section) --- snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php | 2 +- .../v/0.0.0/app/libraries/RainLoop/Config/Application.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index e59c1e612..ac2a05ff8 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -691,7 +691,7 @@ class Actions 'listGrouped' => false, 'MessagesPerPage' => (int) $oConfig->Get('webmail', 'messages_per_page', 25), 'MessageReadDelay' => (int) $oConfig->Get('webmail', 'message_read_delay', 5), - 'MsgDefaultAction' => 1, + 'MsgDefaultAction' => (int) $oConfig->Get('defaults', 'msg_default_action', 1), 'SoundNotification' => true, 'NotificationSound' => 'new-mail', 'DesktopNotifications' => true, diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index 53e77ff5b..0174e5aa5 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -298,7 +298,8 @@ Values: 'contacts_autosave' => array(true), 'mail_use_threads' => array(false), 'allow_draft_autosave' => array(true), - 'mail_reply_same_folder' => array(false) + 'mail_reply_same_folder' => array(false), + 'msg_default_action' => array(1, '1 - reply, 2 - reply all'), ), 'logs' => array( From 2e0077adec0af76bf516d2453eb43471fcc9be20 Mon Sep 17 00:00:00 2001 From: Sergey Mosin Date: Mon, 3 Jul 2023 19:17:22 -0400 Subject: [PATCH 2/5] add 'view_show_next_message' to admin settings ('defaults' section) --- snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php | 2 +- .../v/0.0.0/app/libraries/RainLoop/Config/Application.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index ac2a05ff8..17fc033b9 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -698,7 +698,7 @@ class Actions 'Layout' => (int) $oConfig->Get('defaults', 'view_layout', Enumerations\Layout::SIDE_PREVIEW), 'EditorDefaultType' => \str_replace('Forced', '', $oConfig->Get('defaults', 'view_editor_type', '')), 'UseCheckboxesInList' => (bool) $oConfig->Get('defaults', 'view_use_checkboxes', true), - 'showNextMessage' => false, + 'showNextMessage' => (bool) $oConfig->Get('defaults', 'view_show_next_message', false), 'AutoLogout' => (int) $oConfig->Get('defaults', 'autologout', 30), 'AllowDraftAutosave' => (bool) $oConfig->Get('defaults', 'allow_draft_autosave', true), 'ContactsAutosave' => (bool) $oConfig->Get('defaults', 'contacts_autosave', true), diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index 0174e5aa5..82f6caf11 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -292,6 +292,7 @@ Values: 'view_editor_type' => array('Html', 'Editor mode used by default (Plain, Html)'), 'view_layout' => array(1, 'layout: 0 - no preview, 1 - side preview, 2 - bottom preview'), 'view_use_checkboxes' => array(true), + 'view_show_next_message' => array(true, 'Show next message when (re)move current message'), 'autologout' => array(30), 'view_html' => array(true), 'show_images' => array(false), From c59d19781fec3ed0fbe788c0c8ab96cffafe50f4 Mon Sep 17 00:00:00 2001 From: Sergey Mosin Date: Mon, 3 Jul 2023 23:49:41 -0400 Subject: [PATCH 3/5] add 'view_images' to admin settings ('defaults' section) --- snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php | 4 ++-- .../v/0.0.0/app/libraries/RainLoop/Config/Application.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index 17fc033b9..eb7356db5 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -680,7 +680,7 @@ class Actions 'contactsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(), 'ViewHTML' => (bool) $oConfig->Get('defaults', 'view_html', true), - 'ViewImages' => 'ask', + 'ViewImages' => $oConfig->Get('defaults', 'view_images', 'ask'), 'ViewImagesWhitelist' => '', 'RemoveColors' => (bool) $oConfig->Get('defaults', 'remove_colors', false), 'AllowStyles' => false, @@ -778,7 +778,7 @@ class Actions $aResult['ViewHTML'] = (bool)$oSettings->GetConf('ViewHTML', $aResult['ViewHTML']); $show_images = (bool) $oSettings->GetConf('ShowImages', false); - $aResult['ViewImages'] = $oSettings->GetConf('ViewImages', $show_images ? 'always' : 'ask'); + $aResult['ViewImages'] = $oSettings->GetConf('ViewImages', $show_images ? 'always' : $aResult['ViewImages']); $aResult['ViewImagesWhitelist'] = $oSettings->GetConf('ViewImagesWhitelist', ''); $aResult['RemoveColors'] = (bool)$oSettings->GetConf('RemoveColors', $aResult['RemoveColors']); $aResult['AllowStyles'] = (bool)$oSettings->GetConf('AllowStyles', $aResult['AllowStyles']); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index 82f6caf11..b9c92220c 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -296,6 +296,10 @@ Values: 'autologout' => array(30), 'view_html' => array(true), 'show_images' => array(false), + 'view_images' => array('ask', 'View external images: + "ask" - always ask + "match" - whitelist or ask + "always" - show always'), 'contacts_autosave' => array(true), 'mail_use_threads' => array(false), 'allow_draft_autosave' => array(true), From c75c0e9ed1c16826c16ef8d06bf2966adaa9230d Mon Sep 17 00:00:00 2001 From: Sergey Mosin Date: Tue, 4 Jul 2023 00:06:47 -0400 Subject: [PATCH 4/5] fix: 'reloadTime' function result is passed into 'setInterval' instead of the function --- dev/App/User.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/App/User.js b/dev/App/User.js index 27ad32cba..414694913 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -247,7 +247,7 @@ export class AppUser extends AbstractApp { } }, 1); - setInterval(reloadTime(), 60000); + setInterval(reloadTime, 60000); PgpUserStore.init(); From ceeb55acf2b3059e8ad62d987279e44ec43dd082 Mon Sep 17 00:00:00 2001 From: Sergey Mosin Date: Tue, 4 Jul 2023 14:26:31 -0400 Subject: [PATCH 5/5] improve: only show 'Add "domain.tld" as an application for mailto links?' message after login (firefox shows the message on every reload otherwise). --- dev/App/User.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dev/App/User.js b/dev/App/User.js index 414694913..2ad5c7b5c 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -177,6 +177,7 @@ export class AppUser extends AbstractApp { } logout() { + localStorage.removeItem('register_protocol_offered'); Remote.request('Logout', () => rl.logoutReload(Settings.app('customLogoutLink'))); } @@ -253,12 +254,15 @@ export class AppUser extends AbstractApp { setTimeout(() => mailToHelper(SettingsGet('mailToEmail')), 500); - // When auto-login is active - navigator.registerProtocolHandler?.( - 'mailto', - location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s', - (SettingsGet('title') || 'SnappyMail') - ); + if (!localStorage.getItem('register_protocol_offered')) { + // When auto-login is active + navigator.registerProtocolHandler?.( + 'mailto', + location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s', + (SettingsGet('title') || 'SnappyMail') + ); + localStorage.setItem('register_protocol_offered', '1'); + } } else { this.logout();