Drop use_imap_list_subscribe and use 'HideUnsubscribed' = false

This prevents user questions regarding: "my folders are missing"
This commit is contained in:
the-djmaze 2022-01-12 11:55:41 +01:00
parent 661e937fd1
commit 5757d8d464
11 changed files with 26 additions and 37 deletions

View file

@ -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
});
}
*/

View file

@ -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*/);

View file

@ -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'));
}
};

View file

@ -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
});

View file

@ -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);

View file

@ -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' => '',

View file

@ -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));
}

View file

@ -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)
{

View file

@ -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),

View file

@ -15,7 +15,7 @@
autofocus="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
data-bind="textInput: folderName, onEnter: createFolderCommand" />
</div>
<div class="control-group" data-bind="visible: useImapSubscribe, component: {
<div class="control-group" data-bind="component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_FOLDERS/BUTTON_SUBSCRIBE',

View file

@ -3,7 +3,7 @@
&nbsp;&nbsp;&nbsp;
<i class="icon-spinner" style="margin-top: 5px" data-bind="visible: loading"></i>
</div>
<div style="border-bottom: 1px solid rgba(128,128,128,0.5);margin-bottom:20px;" data-bind="visible: useImapSubscribe, component: {
<div style="border-bottom: 1px solid rgba(128,128,128,0.5);margin-bottom:20px;" data-bind="component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_FOLDERS/HIDE_UNSUBSCRIBED',