Unverified Commit 40a8a4a5 authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #4244 from nextcloud/fix/3979/organizer-avatar-link

Fix and harden logic to extract an avatar link in invitee list
parents 647f4215 a4c7f434
......@@ -2,6 +2,7 @@
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <oc.list@georgehrke.com>
- @author Richard Steinmetz <richard@steinmetz.cloud>
-
- @license GNU AGPL version 3 or any later version
-
......@@ -106,10 +107,18 @@ export default {
},
},
computed: {
/**
* @return {string}
*/
avatarLink() {
// return this.$store.getters.getAvatarForContact(this.uri) || this.commonName
return this.commonName
},
/**
* Common name of the organizer or the uri without the 'mailto:' prefix.
*
* @return {string}
*/
commonName() {
if (this.attendee.commonName) {
return this.attendee.commonName
......@@ -119,7 +128,7 @@ export default {
return removeMailtoPrefix(this.attendee.uri)
}
return this.attendee.uri
return ''
},
radioName() {
return this._uid + '-role-radio-input-group'
......
......@@ -2,6 +2,7 @@
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <oc.list@georgehrke.com>
- @author Richard Steinmetz <richard@steinmetz.cloud>
-
- @license GNU AGPL version 3 or any later version
-
......@@ -40,6 +41,7 @@
<script>
import AvatarParticipationStatus from '../AvatarParticipationStatus'
import { removeMailtoPrefix } from '../../../utils/attendee'
export default {
name: 'OrganizerListItem',
......@@ -57,20 +59,28 @@ export default {
},
},
computed: {
/**
* @return {string}
*/
avatarLink() {
// return this.$store.getters.getAvatarForContact(this.uri) || this.commonName
return this.organizer.commonName
return this.commonName
},
/**
* Common name of the attendee or the uri without the 'mailto:' prefix.
*
* @return {string}
*/
commonName() {
if (this.organizer.commonName) {
return this.organizer.commonName
}
if (this.organizer.uri && this.organizer.uri.startsWith('mailto:')) {
return this.organizer.uri.substr(7)
if (this.organizer.uri) {
return removeMailtoPrefix(this.organizer.uri)
}
return this.organizer.uri
return ''
},
isViewedByOrganizer() {
return true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment