mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Remove most DoFolders loops as they are not used.
And move system folder detection/autocreate to MailboxDetectPlugin because it is hardly used. And by using mailbox.role the default system folder detection is only using (IMAP and JMAP) RFC standards.
This commit is contained in:
parent
8799cd3e8d
commit
54896bf044
18 changed files with 419 additions and 468 deletions
|
|
@ -8,7 +8,7 @@ import {
|
|||
import {
|
||||
ComposeType,
|
||||
EditorDefaultType,
|
||||
SetSystemFoldersNotification
|
||||
FolderType
|
||||
} from 'Common/EnumsUser';
|
||||
|
||||
import { pInt, isArray, arrayLength } from 'Common/Utils';
|
||||
|
|
@ -444,7 +444,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
if (!sSentFolder) {
|
||||
showScreenPopup(FolderSystemPopupView, [SetSystemFoldersNotification.Sent]);
|
||||
showScreenPopup(FolderSystemPopupView, [FolderType.Sent]);
|
||||
} else try {
|
||||
this.sendError(false);
|
||||
this.sending(true);
|
||||
|
|
@ -501,7 +501,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
saveCommand() {
|
||||
if (FolderUserStore.draftsFolderNotEnabled()) {
|
||||
showScreenPopup(FolderSystemPopupView, [SetSystemFoldersNotification.Draft]);
|
||||
showScreenPopup(FolderSystemPopupView, [FolderType.Drafts]);
|
||||
} else {
|
||||
this.savedError(false);
|
||||
this.saving(true);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
import { koComputable, addSubscribablesTo } from 'External/ko';
|
||||
|
||||
import { SetSystemFoldersNotification } from 'Common/EnumsUser';
|
||||
import { FolderType } from 'Common/EnumsUser';
|
||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
import { defaultOptionsAfterRender } from 'Common/Utils';
|
||||
import { folderListOptionsBuilder } from 'Common/Folders';
|
||||
|
|
@ -47,24 +47,24 @@ export class FolderSystemPopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {number=} notificationType = SetSystemFoldersNotification.None
|
||||
* @param {number=} notificationType = 0
|
||||
*/
|
||||
onShow(notificationType = SetSystemFoldersNotification.None) {
|
||||
onShow(notificationType = 0) {
|
||||
let notification = '', prefix = 'POPUPS_SYSTEM_FOLDERS/NOTIFICATION_';
|
||||
switch (notificationType) {
|
||||
case SetSystemFoldersNotification.Sent:
|
||||
case FolderType.Sent:
|
||||
notification = i18n(prefix + 'SENT');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Draft:
|
||||
case FolderType.Drafts:
|
||||
notification = i18n(prefix + 'DRAFTS');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Spam:
|
||||
case FolderType.Junk:
|
||||
notification = i18n(prefix + 'SPAM');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Trash:
|
||||
case FolderType.Trash:
|
||||
notification = i18n(prefix + 'TRASH');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Archive:
|
||||
case FolderType.Archive:
|
||||
notification = i18n(prefix + 'ARCHIVE');
|
||||
break;
|
||||
// no default
|
||||
|
|
|
|||
|
|
@ -364,11 +364,11 @@ export class MailMessageList extends AbstractViewRight {
|
|||
}
|
||||
|
||||
spamCommand() {
|
||||
moveMessagesToFolderType(FolderType.Spam);
|
||||
moveMessagesToFolderType(FolderType.Junk);
|
||||
}
|
||||
|
||||
notSpamCommand() {
|
||||
moveMessagesToFolderType(FolderType.NotSpam);
|
||||
moveMessagesToFolderType(FolderType.Inbox);
|
||||
}
|
||||
|
||||
moveCommand(vm, event) {
|
||||
|
|
|
|||
|
|
@ -220,8 +220,8 @@ export class MailMessageView extends AbstractViewRight {
|
|||
this.deleteCommand = createCommandActionHelper(FolderType.Trash);
|
||||
this.deleteWithoutMoveCommand = createCommandActionHelper(FolderType.Trash, true);
|
||||
this.archiveCommand = createCommandActionHelper(FolderType.Archive);
|
||||
this.spamCommand = createCommandActionHelper(FolderType.Spam);
|
||||
this.notSpamCommand = createCommandActionHelper(FolderType.NotSpam);
|
||||
this.spamCommand = createCommandActionHelper(FolderType.Junk);
|
||||
this.notSpamCommand = createCommandActionHelper(FolderType.Inbox);
|
||||
|
||||
decorateKoCommands(this, {
|
||||
editCommand: self => self.messageVisibility(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue