mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Added: allow setting the supported THREAD algorithm
This commit is contained in:
parent
015dcbdc41
commit
57fbdf8795
48 changed files with 341 additions and 264 deletions
|
|
@ -15,6 +15,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
|
|||
|
||||
import { AppUserStore } from 'Stores/User/App';
|
||||
import { LanguageStore } from 'Stores/Language';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
import { IdentityUserStore } from 'Stores/User/Identity';
|
||||
import { NotificationUserStore } from 'Stores/User/Notification';
|
||||
|
|
@ -32,14 +33,6 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
|||
this.language = LanguageStore.language;
|
||||
this.languages = LanguageStore.languages;
|
||||
this.hourCycle = LanguageStore.hourCycle;
|
||||
/*
|
||||
// 'THREAD=REFS', 'THREAD=REFERENCES', 'THREAD=ORDEREDSUBJECT'
|
||||
this.threadModes = ko.observableArray();
|
||||
AppUserStore.capabilities.forEach(capa =>
|
||||
capa.startsWith('THREAD=') && this.threadModes.push(capa.slice(7))
|
||||
);
|
||||
this.threadModes.sort((a, b) => a.length - b.length);
|
||||
*/
|
||||
|
||||
this.soundNotification = SMAudio.notifications;
|
||||
this.notificationSound = ko.observable(SettingsGet('NotificationSound'));
|
||||
|
|
@ -49,8 +42,15 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
|||
this.isDesktopNotificationAllowed = NotificationUserStore.allowed;
|
||||
|
||||
this.threadsAllowed = AppUserStore.threadsAllowed;
|
||||
// 'THREAD=REFS', 'THREAD=REFERENCES', 'THREAD=ORDEREDSUBJECT'
|
||||
this.threadAlgorithms = ko.observableArray();
|
||||
FolderUserStore.capabilities.forEach(capa =>
|
||||
capa.startsWith('THREAD=') && this.threadAlgorithms.push(capa.slice(7))
|
||||
);
|
||||
this.threadAlgorithms.sort((a, b) => a.length - b.length);
|
||||
this.threadAlgorithm = SettingsUserStore.threadAlgorithm;
|
||||
|
||||
['useThreads',
|
||||
['useThreads', 'threadAlgorithm',
|
||||
// These use addSetting()
|
||||
'layout', 'messageReadDelay', 'messagesPerPage', 'checkMailInterval',
|
||||
'editorDefaultType', 'editorWysiwyg', 'msgDefaultAction', 'maxBlockquotesLevel',
|
||||
|
|
@ -154,6 +154,11 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
|||
Remote.saveSetting('UseThreads', value);
|
||||
},
|
||||
|
||||
threadAlgorithm: value => {
|
||||
MessagelistUserStore([]);
|
||||
Remote.saveSetting('threadAlgorithm', value);
|
||||
},
|
||||
|
||||
checkMailInterval: () => {
|
||||
setRefreshFoldersInterval(SettingsUserStore.checkMailInterval());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -313,6 +313,7 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
|
|||
|
||||
if (AppUserStore.threadsAllowed() && SettingsUserStore.useThreads()) {
|
||||
params.useThreads = 1;
|
||||
params.threadAlgorithm = SettingsUserStore.threadAlgorithm();
|
||||
params.threadUid = MessagelistUserStore.threadUid();
|
||||
} else {
|
||||
params.threadUid = 0;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export const SettingsUserStore = new class {
|
|||
showNextMessage: 0,
|
||||
allowDraftAutosave: 1,
|
||||
useThreads: 0,
|
||||
threadAlgorithm: '',
|
||||
replySameFolder: 0,
|
||||
hideUnsubscribed: 0,
|
||||
hideDeleted: 1,
|
||||
|
|
@ -99,7 +100,8 @@ export const SettingsUserStore = new class {
|
|||
'listGrouped',
|
||||
'showNextMessage',
|
||||
'AllowDraftAutosave',
|
||||
'UseThreads',
|
||||
'useThreads',
|
||||
'threadAlgorithm',
|
||||
'ReplySameFolder',
|
||||
'HideUnsubscribed',
|
||||
'HideDeleted',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue