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

Unverified Commit a4c7f434 authored by Richard Steinmetz's avatar Richard Steinmetz
Browse files

Fix and harden logic to extract an avatar link in invitee list

parent 2dd7e934
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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'
+14 −4
Original line number Diff line number Diff line
@@ -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