summaryrefslogtreecommitdiffstats
path: root/src/models/contact.js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-31 12:08:51 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-31 12:08:51 +0200
commitd4085a670ec618da78a627d20035b96c5901cd38 (patch)
tree63c1aaa03f60c40c9b06b9f349c0c6c55d4050b8 /src/models/contact.js
parentff5347795ced18d2f0ec0e005ccc1cc3bbb69a24 (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.js26
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