diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-09-21 11:09:21 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-09-25 14:52:43 +0200 |
commit | cffaf4a6a252f3f56424dc1c6f9f8d265be3e813 (patch) | |
tree | ca42f1dedfd122b22f700c35b1fe27e0dc319d74 /src/models | |
parent | 38f9f3446750f501193aef15506303975450056d (diff) |
Really load the server contacts
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/contact.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/models/contact.js b/src/models/contact.js index 438b1f22..63b3b777 100644 --- a/src/models/contact.js +++ b/src/models/contact.js @@ -28,11 +28,12 @@ export default class Contact { /** * Creates an instance of Contact * - * @param {string} [vcard] the vcard data as string with proper new lines - * @param {object} [addressbook] the addressbook which the contat belongs to + * @param {string} vcard the vcard data as string with proper new lines + * @param {object} addressbook the addressbook which the contat belongs to + * @param {string} [url] the url of the contact * @memberof Contact */ - constructor(vcard = '', addressbook) { + constructor(vcard = '', addressbook, url) { let jCal = ICAL.parse(vcard) if (jCal[0] !== 'vcard') { throw new Error('Only one contact is allowed in the vcard data') @@ -41,6 +42,7 @@ export default class Contact { this.jCal = jCal this.addressbook = addressbook this.vCard = new ICAL.Component(this.jCal) + this.url = url // if no uid set, create one if (!this.vCard.hasProperty('uid')) { |