diff options
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 |