summaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-04-08 18:01:55 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-04-08 18:01:58 +0200
commit6a9025c57dfd738d3d25651853bc38e15db90f1c (patch)
treefb545afd3a5aa14a68650b52bfa13ed8639d0382 /src/components
parentb362ada605080ed528f379da74f78c726a9a9a6e (diff)
Fallback to unknown photo mimetype
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ContactsList/ContactsListItem.vue6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/components/ContactsList/ContactsListItem.vue b/src/components/ContactsList/ContactsListItem.vue
index 98043703..22f8b6b4 100644
--- a/src/components/ContactsList/ContactsListItem.vue
+++ b/src/components/ContactsList/ContactsListItem.vue
@@ -104,6 +104,12 @@ export default {
},
avatarUrl() {
if (this.contact.photo) {
+ const type = this.contact.vCard.getFirstProperty('photo').type
+ if (!this.contact.photo.startsWith('data') && type === 'binary') {
+ // split on coma in case of any leftover base64 data and retrieve last part
+ // usually we come to this part when the base64 image type is unknown
+ return `url(data:image;base64,${this.contact.photo.split(',').pop()})`
+ }
return `url(${this.contact.photo})`
}
return `url(${this.contact.url}?photo)`