snappymail/dev/Model/EmailCollection.js

25 lines
626 B
JavaScript
Raw Normal View History

import { AbstractCollectionModel } from 'Model/AbstractCollection';
import { EmailModel } from 'Model/Email';
'use strict';
export class EmailCollectionModel extends AbstractCollectionModel
{
/**
* @param {?Array} json
* @returns {EmailCollectionModel}
*/
static reviveFromJson(items) {
2020-10-23 21:15:54 +08:00
return super.reviveFromJson(items, email => EmailModel.reviveFromJson(email));
}
/**
* @param {boolean=} friendlyView = false
* @param {boolean=} wrapWithLink = false
* @returns {string}
*/
2022-09-30 17:38:51 +08:00
toString(friendlyView, wrapWithLink) {
return this.map(email => email.toLine(friendlyView, wrapWithLink)).join(', ');
}
}