mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08:00
41 lines
708 B
JavaScript
41 lines
708 B
JavaScript
import { AbstractModel } from 'Knoin/AbstractModel';
|
|
import { addObservablesTo } from 'External/ko';
|
|
|
|
export class IdentityModel extends AbstractModel {
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} email
|
|
*/
|
|
constructor() {
|
|
super();
|
|
|
|
addObservablesTo(this, {
|
|
id: '',
|
|
label: '',
|
|
email: '',
|
|
name: '',
|
|
|
|
replyTo: '',
|
|
bcc: '',
|
|
sentFolder: '',
|
|
|
|
signature: '',
|
|
signatureInsertBefore: false,
|
|
|
|
pgpSign: false,
|
|
pgpEncrypt: false,
|
|
|
|
askDelete: false
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
formattedName() {
|
|
const name = this.name(),
|
|
email = this.email(),
|
|
label = this.label();
|
|
return (name ? `${name} ` : '') + `<${email}>` + (label ? ` (${label})` : '');
|
|
}
|
|
}
|