mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Bugfix: revamp MessageModel broke flags cache
And took the liberty to put all MessageFlagsCache functions into a class
This commit is contained in:
parent
d7a4639d6b
commit
22f606ea75
9 changed files with 157 additions and 161 deletions
|
|
@ -18,7 +18,7 @@ import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
|||
import { upload } from 'Common/Links';
|
||||
import { i18n, getNotification, getUploadErrorDescByCode } from 'Common/Translator';
|
||||
import { format as momentorFormat } from 'Common/Momentor';
|
||||
import { getMessageFlagsFromCache, setMessageFlagsToCache, setFolderHash } from 'Common/Cache';
|
||||
import { MessageFlagsCache, setFolderHash } from 'Common/Cache';
|
||||
|
||||
import { HtmlEditor } from 'Common/HtmlEditor';
|
||||
|
||||
|
|
@ -402,7 +402,7 @@ class ComposePopupView extends AbstractViewNext {
|
|||
this.sending(true);
|
||||
|
||||
if (Array.isArray(this.aDraftInfo) && 3 === this.aDraftInfo.length) {
|
||||
const flagsCache = getMessageFlagsFromCache(this.aDraftInfo[2], this.aDraftInfo[1]);
|
||||
const flagsCache = MessageFlagsCache.getFlags(this.aDraftInfo[2], this.aDraftInfo[1]);
|
||||
if (flagsCache) {
|
||||
if ('forward' === this.aDraftInfo[0]) {
|
||||
flagsCache[3] = true;
|
||||
|
|
@ -410,7 +410,7 @@ class ComposePopupView extends AbstractViewNext {
|
|||
flagsCache[2] = true;
|
||||
}
|
||||
|
||||
setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], flagsCache);
|
||||
MessageFlagsCache.setFor(this.aDraftInfo[2], this.aDraftInfo[1], flagsCache);
|
||||
rl.app.reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
setFolderHash(this.aDraftInfo[2], '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import { i18n, initOnStartOrLangChange } from 'Common/Translator';
|
|||
|
||||
import {
|
||||
getFolderFromCacheList,
|
||||
clearMessageFlagsFromCacheByFolder,
|
||||
MessageFlagsCache,
|
||||
hasRequestedMessage,
|
||||
addRequestedMessage
|
||||
} from 'Common/Cache';
|
||||
|
|
@ -520,7 +520,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
folder.messageCountUnread(0);
|
||||
}
|
||||
|
||||
clearMessageFlagsFromCacheByFolder(sFolderFullNameRaw);
|
||||
MessageFlagsCache.clearFolder(sFolderFullNameRaw);
|
||||
}
|
||||
|
||||
Remote.messageSetSeenToAll(()=>{}, sFolderFullNameRaw, true, sThreadUid ? uids : null);
|
||||
|
|
@ -546,7 +546,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
folder.messageCountUnread(folder.messageCountAll());
|
||||
}
|
||||
|
||||
clearMessageFlagsFromCacheByFolder(sFolderFullNameRaw);
|
||||
MessageFlagsCache.clearFolder(sFolderFullNameRaw);
|
||||
}
|
||||
|
||||
Remote.messageSetSeenToAll(()=>{}, sFolderFullNameRaw, false, sThreadUid ? uids : null);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import Audio from 'Common/Audio';
|
|||
import { i18n } from 'Common/Translator';
|
||||
import { attachmentDownload } from 'Common/Links';
|
||||
|
||||
import { storeMessageFlagsToCache } from 'Common/Cache';
|
||||
import { MessageFlagsCache } from 'Common/Cache';
|
||||
|
||||
import AppStore from 'Stores/User/App';
|
||||
import SettingsStore from 'Stores/User/Settings';
|
||||
|
|
@ -771,7 +771,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
|||
|
||||
oMessage.isReadReceipt(true);
|
||||
|
||||
storeMessageFlagsToCache(oMessage);
|
||||
MessageFlagsCache.store(oMessage);
|
||||
|
||||
rl.app.reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue