mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 15:08:28 +03:00
Improved MIME email addresses parse info
This commit is contained in:
parent
ec9197cb85
commit
be8d302b82
4 changed files with 34 additions and 12 deletions
|
|
@ -52,4 +52,24 @@ export class EmailCollectionModel extends AbstractCollectionModel
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {array} [{name: "Name", email: "address@domain"}]
|
||||
*/
|
||||
/*
|
||||
static fromArray(addresses) {
|
||||
let list = new this();
|
||||
list.fromArray(addresses);
|
||||
return list;
|
||||
}
|
||||
fromArray(addresses) {
|
||||
addresses.forEach(item => {
|
||||
item = new EmailModel(item.email, item.name);
|
||||
// Make them unique
|
||||
if (item.email && item.name || !this.find(address => address.email == item.email)) {
|
||||
this.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue