Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable6.0] fix: check if photo property is set before downloading #4251

Open
wants to merge 1 commit into
base: stable6.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/ContactsList/ContactsListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default {
return
}
this.avatarUrl = photoUrl
} else if (this.source.url) {
} else if (this.source.hasPhoto && this.source.url) {
this.avatarUrl = `${this.source.url}?photo`
}
},
Expand Down
10 changes: 10 additions & 0 deletions src/models/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ export default class Contact {
this.vCard.updatePropertyWithValue('photo', photo)
}

/**
* Return whether a photo is available
*
* @readonly
* @memberof Contact
*/
get hasPhoto() {
return this.dav && this.dav.hasphoto
}

/**
* Return the photo usable url
* We cannot fetch external url because of csp policies
Expand Down
Loading