Merge getNameAndEmailHelper() into newMessageCommand()

This commit is contained in:
the-djmaze 2023-12-11 11:50:02 +01:00
parent 08257f47cb
commit c1c851c238
2 changed files with 16 additions and 27 deletions

View file

@ -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