diff --git a/dev/Remote/User/Fetch.js b/dev/Remote/User/Fetch.js index 0071f2b8e..d6484b5f2 100644 --- a/dev/Remote/User/Fetch.js +++ b/dev/Remote/User/Fetch.js @@ -216,10 +216,11 @@ class RemoteUserFetch extends AbstractFetchRemote { } /* - folderMove(sPrevFolderFullName, sNewFolderFullName) { + folderMove(sPrevFolderFullName, sNewFolderFullName, bSubscribe) { return this.post('FolderMove', FolderUserStore.foldersRenaming, { Folder: sPrevFolderFullName, - NewFolder: sNewFolderFullName + NewFolder: sNewFolderFullName, + Subscribe: bSubscribe ? 1 : 0 }); } */ diff --git a/dev/Settings/User/Folders.js b/dev/Settings/User/Folders.js index 7a6030d8f..7693f3c5b 100644 --- a/dev/Settings/User/Folders.js +++ b/dev/Settings/User/Folders.js @@ -62,7 +62,6 @@ export class FoldersUserSettings /*extends AbstractViewSettings*/ { this.folderForEdit = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'edited'] }); - this.useImapSubscribe = Settings.app('useImapSubscribe'); SettingsUserStore.hideUnsubscribed.subscribe(value => Remote.saveSetting('HideUnsubscribed', value ? 1 : 0)); } @@ -72,7 +71,8 @@ export class FoldersUserSettings /*extends AbstractViewSettings*/ { if (nameToEdit && folder.name() !== nameToEdit) { Remote.abort('Folders').post('FolderRename', FolderUserStore.foldersRenaming, { Folder: folder.fullName, - NewFolderName: nameToEdit + NewFolderName: nameToEdit, + Subscribe: folder.subscribed() ? 1 : 0 }) .then(data => { folder.name(nameToEdit/*data.Name*/); diff --git a/dev/Stores/User/Settings.js b/dev/Stores/User/Settings.js index f944474b5..19cd7f08c 100644 --- a/dev/Stores/User/Settings.js +++ b/dev/Stores/User/Settings.js @@ -3,7 +3,7 @@ import { koComputable } from 'External/ko'; import { Layout, EditorDefaultType } from 'Common/EnumsUser'; import { pInt, addObservablesTo } from 'Common/Utils'; -import { $htmlCL, Settings, SettingsGet } from 'Common/Globals'; +import { $htmlCL, SettingsGet } from 'Common/Globals'; import { ThemeStore } from 'Stores/Theme'; export const SettingsUserStore = new class { @@ -34,7 +34,7 @@ export const SettingsUserStore = new class { allowDraftAutosave: 1, useThreads: 0, replySameFolder: 0, - hideUnsubscribed: 1, + hideUnsubscribed: 0, autoLogout: 0 }); @@ -74,13 +74,13 @@ export const SettingsUserStore = new class { self.messageReadDelay(pInt(SettingsGet('MessageReadDelay'))); self.autoLogout(pInt(SettingsGet('AutoLogout'))); - self.showImages(!!SettingsGet('ShowImages')); - self.removeColors(!!SettingsGet('RemoveColors')); - self.useCheckboxesInList(!!SettingsGet('UseCheckboxesInList')); - self.allowDraftAutosave(!!SettingsGet('AllowDraftAutosave')); - self.useThreads(!!SettingsGet('UseThreads')); - self.replySameFolder(!!SettingsGet('ReplySameFolder')); + self.showImages(SettingsGet('ShowImages')); + self.removeColors(SettingsGet('RemoveColors')); + self.useCheckboxesInList(SettingsGet('UseCheckboxesInList')); + self.allowDraftAutosave(SettingsGet('AllowDraftAutosave')); + self.useThreads(SettingsGet('UseThreads')); + self.replySameFolder(SettingsGet('ReplySameFolder')); - self.hideUnsubscribed(Settings.app('useImapSubscribe') && SettingsGet('HideUnsubscribed')); + self.hideUnsubscribed(SettingsGet('HideUnsubscribed')); } }; diff --git a/dev/View/Popup/FolderCreate.js b/dev/View/Popup/FolderCreate.js index 443f4d67d..8910fc3bb 100644 --- a/dev/View/Popup/FolderCreate.js +++ b/dev/View/Popup/FolderCreate.js @@ -5,7 +5,6 @@ import { UNUSED_OPTION_VALUE } from 'Common/Consts'; import { defaultOptionsAfterRender } from 'Common/Utils'; import { folderListOptionsBuilder, sortFolders } from 'Common/UtilsUser'; import { getNotification } from 'Common/Translator'; -import { Settings } from 'Common/Globals'; import { FolderUserStore } from 'Stores/User/Folder'; import { SettingsUserStore } from 'Stores/User/Settings'; @@ -22,11 +21,9 @@ class FolderCreatePopupView extends AbstractViewPopup { constructor() { super('FolderCreate'); - this.useImapSubscribe = Settings.app('useImapSubscribe'); - this.addObservables({ folderName: '', - folderSubscribe: this.useImapSubscribe && SettingsUserStore.hideUnsubscribed, + folderSubscribe: SettingsUserStore.hideUnsubscribed(), selectedParentValue: UNUSED_OPTION_VALUE }); diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php index 7163100f9..90f32a365 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php @@ -1224,7 +1224,7 @@ class MailClient * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Mail\Exceptions\RuntimeException */ - public function FolderDelete(string $sFolderFullName, bool $bUnsubscribeOnDeletion = true) : self + public function FolderDelete(string $sFolderFullName) : self { if (!\strlen($sFolderFullName) || 'INBOX' === $sFolderFullName) { throw new \MailSo\Base\Exceptions\InvalidArgumentException; @@ -1239,9 +1239,7 @@ class MailClient throw new Exceptions\NonEmptyFolder; } - if ($bUnsubscribeOnDeletion) { - $this->oImapClient->FolderUnsubscribe($sFolderFullName); - } + $this->oImapClient->FolderUnsubscribe($sFolderFullName); $this->oImapClient->FolderUnselect(); $this->oImapClient->FolderDelete($sFolderFullName); 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 9c94150c7..4fd684c82 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -660,7 +660,6 @@ class Actions 'allowCtrlEnterOnCompose' => (bool)$oConfig->Get('labs', 'allow_ctrl_enter_on_compose', false), 'hideSubmitButton' => (bool)$oConfig->Get('login', 'hide_submit_button', true), 'useImapThread' => (bool)$oConfig->Get('labs', 'use_imap_thread', false), - 'useImapSubscribe' => (bool)$oConfig->Get('labs', 'use_imap_list_subscribe', true), 'allowAppendMessage' => (bool)$oConfig->Get('labs', 'allow_message_append', false), 'folderSpecLimit' => (int)$oConfig->Get('labs', 'folders_spec_limit', 50), 'faviconStatus' => (bool)$oConfig->Get('labs', 'favicon_status', true), @@ -738,7 +737,7 @@ class Actions 'AllowDraftAutosave' => (bool) $oConfig->Get('defaults', 'allow_draft_autosave', true), 'ReplySameFolder' => (bool) $oConfig->Get('defaults', 'mail_reply_same_folder', false), 'ContactsAutosave' => (bool) $oConfig->Get('defaults', 'contacts_autosave', true), - 'HideUnsubscribed' => (bool) $oConfig->Get('labs', 'use_imap_list_subscribe', true), + 'HideUnsubscribed' => false, 'MainEmail' => '', 'InterfaceAnimation' => true, 'UserBackgroundName' => '', diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Accounts.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Accounts.php index 58f317db4..2a0a1e274 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Accounts.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Accounts.php @@ -156,7 +156,7 @@ trait Accounts $aResult['SpamFolder'] = (string) $oSettingsLocal->GetConf('SpamFolder', ''); $aResult['TrashFolder'] = (string) $oSettingsLocal->GetConf('TrashFolder', ''); $aResult['ArchiveFolder'] = (string) $oSettingsLocal->GetConf('ArchiveFolder', ''); - $aResult['HideUnsubscribed'] = (bool) $oSettingsLocal->GetConf('HideUnsubscribed', $oConfig->Get('labs', 'use_imap_list_subscribe', true)); + $aResult['HideUnsubscribed'] = (bool) $oSettingsLocal->GetConf('HideUnsubscribed', false); $aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $oConfig->Get('defaults', 'mail_use_threads', false)); $aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $oConfig->Get('defaults', 'mail_reply_same_folder', false)); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php index 0d069f929..2f31bb89c 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php @@ -54,7 +54,7 @@ trait Folders { $oAccount = $this->initMailClientConnection(); - $HideUnsubscribed = $this->Config()->Get('labs', 'use_imap_list_subscribe', true); + $HideUnsubscribed = false; $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); if ($oSettingsLocal instanceof \RainLoop\Settings) { $HideUnsubscribed = (bool) $oSettingsLocal->GetConf('HideUnsubscribed', $HideUnsubscribed); @@ -68,8 +68,6 @@ trait Folders $this->Plugins()->RunHook('filter.folders-post', array($oAccount, $oFolderCollection)); - $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); - $aSystemFolders = array(); $this->recFoldersTypes($oAccount, $oFolderCollection, $aSystemFolders); @@ -226,7 +224,7 @@ trait Folders $oFolder = $this->MailClient()->FolderCreate( $this->GetActionParam('Folder', ''), $this->GetActionParam('Parent', ''), - !!$this->GetActionParam('Subscribe', !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true)) + !!$this->GetActionParam('Subscribe', 1) ); // FolderInformation(string $sFolderName, int $iPrevUidNext = 0, array $aUids = array()) @@ -331,7 +329,7 @@ trait Folders $this->MailClient()->FolderMove( $this->GetActionParam('Folder', ''), $this->GetActionParam('NewFolder', ''), - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true) + !!$this->GetActionParam('Subscribe', 1) ); } catch (\Throwable $oException) @@ -355,7 +353,7 @@ trait Folders $sFullName = $this->MailClient()->FolderRename( $this->GetActionParam('Folder', ''), $sName, - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true) + !!$this->GetActionParam('Subscribe', 1) ); } catch (\Throwable $oException) @@ -379,10 +377,7 @@ trait Folders try { - $this->MailClient()->FolderDelete( - $this->GetActionParam('Folder', ''), - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true) - ); + $this->MailClient()->FolderDelete($this->GetActionParam('Folder', '')); } catch (\MailSo\Mail\Exceptions\NonEmptyFolder $oException) { 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 230b78667..c9ca98d15 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 @@ -338,7 +338,6 @@ Enables caching in the system'), 'use_app_debug_css' => array(false), 'use_imap_sort' => array(true), 'use_imap_force_selection' => array(false), - 'use_imap_list_subscribe' => array(true), 'use_imap_thread' => array(true), 'use_imap_move' => array(false), 'use_imap_expunge_all_on_delete' => array(false), diff --git a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html index 840168f1b..f7aadc860 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html @@ -15,7 +15,7 @@ autofocus="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="textInput: folderName, onEnter: createFolderCommand" /> -