diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-31 12:08:51 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-31 12:08:51 +0200 |
commit | d4085a670ec618da78a627d20035b96c5901cd38 (patch) | |
tree | 63c1aaa03f60c40c9b06b9f349c0c6c55d4050b8 /src/models/contact.js | |
parent | ff5347795ced18d2f0ec0e005ccc1cc3bbb69a24 (diff) |
Groups selection and init 1
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/models/contact.js')
-rw-r--r-- | src/models/contact.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/models/contact.js b/src/models/contact.js index 6f97f47e..a517f751 100644 --- a/src/models/contact.js +++ b/src/models/contact.js @@ -1,4 +1,4 @@ -/* +/** * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com> * * @author John Molakvoæ <skjnldsv@protonmail.com> @@ -93,6 +93,30 @@ export default class Contact { } /** + * Return the groups + * + * @readonly + * @memberof Contact + */ + get groups() { + let prop = this.vCard.getFirstProperty('categories') + if (prop) { + return this.vCard.getFirstProperty('categories').getValues() + } + return [] + } + + /** + * Return the groups + * + * @readonly + * @memberof Contact + */ + get kind() { + return this.firstIfArray(this.vCard.getFirstPropertyValue('kind')) + } + + /** * Return the first email * * @readonly |