mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 11:39:21 +03:00
Merge getNameAndEmailHelper() into newMessageCommand()
This commit is contained in:
parent
08257f47cb
commit
c1c851c238
2 changed files with 16 additions and 27 deletions
|
|
@ -135,29 +135,6 @@ export class ContactModel extends AbstractModel {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Array|null}
|
||||
*/
|
||||
getNameAndEmailHelper() {
|
||||
let name = (this.givenName() + ' ' + this.surName()).trim(),
|
||||
email = [],
|
||||
addresses = this.email();
|
||||
|
||||
if (this.sendToAll()) {
|
||||
addresses.forEach(key => email.push(key.value()));
|
||||
} else if (addresses.length) {
|
||||
email.push(addresses[0].value());
|
||||
}
|
||||
/*
|
||||
// this.jCard.getOne('fn')?.notEmpty() ||
|
||||
this.jCard.parseFullName({set:true});
|
||||
// let name = this.jCard.getOne('nickname'),
|
||||
let name = this.jCard.getOne('fn'),
|
||||
email = [this.jCard.getOne('email')];
|
||||
*/
|
||||
return email.length ? [name, email] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @param {jCard} json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue