diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-09-28 19:01:07 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-09-28 19:01:07 +0200 |
commit | f285b76b6c18e9f9642dde9ea1a8a25efb67ee4a (patch) | |
tree | ce2ca3cedbaa6c7eb3fba8987e0ec7c034e6fbe4 /src/models | |
parent | 4169161824c741093e85455c57314ee475088ffd (diff) |
Move addressbook
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/contact.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/models/contact.js b/src/models/contact.js index b0eec0a5..f19ce260 100644 --- a/src/models/contact.js +++ b/src/models/contact.js @@ -30,11 +30,10 @@ export default class 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} [url=''] the url of the contact * @param {string} [etag=''] the current etag of the contact * @memberof Contact */ - constructor(vcard, addressbook, url = '', etag = '') { + constructor(vcard, addressbook, etag = '') { if (typeof vcard !== 'string' || vcard.length === 0) { throw new Error('Invalid vCard') } @@ -47,7 +46,6 @@ export default class Contact { this.jCal = jCal this.addressbook = addressbook this.vCard = new ICAL.Component(this.jCal) - this.url = url this.conflict = false // if no uid set, create one @@ -92,6 +90,18 @@ export default class Contact { } /** + * Return the url + * + * @readonly + * @memberof Contact + */ + get url() { + if (this.dav) { + return this.dav.url + } + } + + /** * Return the uid * * @readonly |