mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-29 11:01:34 +08:00
45 lines
900 B
JavaScript
45 lines
900 B
JavaScript
import { AbstractCollectionModel } from 'Model/AbstractCollection';
|
|
import { MessageModel } from 'Model/Message';
|
|
|
|
import {
|
|
MessageFlagsCache
|
|
} from 'Common/Cache';
|
|
|
|
'use strict';
|
|
|
|
export class MessageCollectionModel extends AbstractCollectionModel
|
|
{
|
|
/*
|
|
constructor() {
|
|
super();
|
|
this.Filtered
|
|
this.Folder
|
|
this.FolderHash
|
|
this.FolderInfo
|
|
this.totalEmails
|
|
this.unreadEmails
|
|
this.MessageResultCount
|
|
this.UidNext
|
|
this.ThreadUid
|
|
this.NewMessages
|
|
this.Offset
|
|
this.Limit
|
|
this.Search
|
|
}
|
|
*/
|
|
|
|
/**
|
|
* @param {?Object} json
|
|
* @returns {MessageCollectionModel}
|
|
*/
|
|
static reviveFromJson(object, cached) {
|
|
return super.reviveFromJson(object, message => {
|
|
message = MessageModel.reviveFromJson(message);
|
|
if (message) {
|
|
message.deleted(false);
|
|
cached ? MessageFlagsCache.initMessage(message) : MessageFlagsCache.store(message);
|
|
return message;
|
|
}
|
|
});
|
|
}
|
|
}
|