mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-30 18:26:43 +03:00
37 lines
865 B
JavaScript
37 lines
865 B
JavaScript
import { AbstractCollectionModel } from 'Model/AbstractCollection';
|
|
import { MessageModel } from 'Model/Message';
|
|
import { MessageUserStore } from 'Stores/User/Message';
|
|
|
|
'use strict';
|
|
|
|
export class MessageCollectionModel extends AbstractCollectionModel
|
|
{
|
|
/*
|
|
constructor() {
|
|
super();
|
|
this.filtered
|
|
this.folder
|
|
this.totalEmails
|
|
this.totalThreads
|
|
this.threadUid
|
|
this.newMessages
|
|
this.offset
|
|
this.limit
|
|
this.search
|
|
this.limited
|
|
}
|
|
*/
|
|
|
|
/**
|
|
* @param {?Object} json
|
|
* @returns {MessageCollectionModel}
|
|
*/
|
|
static reviveFromJson(object/*, cached*/) {
|
|
let msg = MessageUserStore.message();
|
|
return super.reviveFromJson(object, message =>
|
|
// If message is currently viewed, use that.
|
|
// Maybe then use msg.revivePropertiesFromJson(message) ?
|
|
(msg && msg.hash === message.hash) ? msg : MessageModel.reviveFromJson(message)
|
|
);
|
|
}
|
|
}
|