Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@
  - @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
  - @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
  -
  -
  - @author 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
  - @license GNU AGPL version 3 or any later version
  -
  -
@@ -106,10 +107,18 @@ export default {
		},
		},
	},
	},
	computed: {
	computed: {
		/**
		 * @return {string}
		 */
		avatarLink() {
		avatarLink() {
			// return this.$store.getters.getAvatarForContact(this.uri) || this.commonName
			// return this.$store.getters.getAvatarForContact(this.uri) || this.commonName
			return this.commonName
			return this.commonName
		},
		},
		/**
		 * Common name of the organizer or the uri without the 'mailto:' prefix.
		 *
		 * @return {string}
		 */
		commonName() {
		commonName() {
			if (this.attendee.commonName) {
			if (this.attendee.commonName) {
				return this.attendee.commonName
				return this.attendee.commonName
@@ -119,7 +128,7 @@ export default {
				return removeMailtoPrefix(this.attendee.uri)
				return removeMailtoPrefix(this.attendee.uri)
			}
			}


			return this.attendee.uri
			return ''
		},
		},
		radioName() {
		radioName() {
			return this._uid + '-role-radio-input-group'
			return this._uid + '-role-radio-input-group'
+14 −4
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@
  - @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
  - @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
  -
  -
  - @author 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
  - @license GNU AGPL version 3 or any later version
  -
  -
@@ -40,6 +41,7 @@


<script>
<script>
import AvatarParticipationStatus from '../AvatarParticipationStatus'
import AvatarParticipationStatus from '../AvatarParticipationStatus'
import { removeMailtoPrefix } from '../../../utils/attendee'


export default {
export default {
	name: 'OrganizerListItem',
	name: 'OrganizerListItem',
@@ -57,20 +59,28 @@ export default {
		},
		},
	},
	},
	computed: {
	computed: {
		/**
		 * @return {string}
		 */
		avatarLink() {
		avatarLink() {
			// return this.$store.getters.getAvatarForContact(this.uri) || this.commonName
			// 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() {
		commonName() {
			if (this.organizer.commonName) {
			if (this.organizer.commonName) {
				return this.organizer.commonName
				return this.organizer.commonName
			}
			}


			if (this.organizer.uri && this.organizer.uri.startsWith('mailto:')) {
			if (this.organizer.uri) {
				return this.organizer.uri.substr(7)
				return removeMailtoPrefix(this.organizer.uri)
			}
			}


			return this.organizer.uri
			return ''
		},
		},
		isViewedByOrganizer() {
		isViewedByOrganizer() {
			return true
			return true