From d95c1c605f749aef3d4555dd8dd022434f7f012a Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Wed, 20 Nov 2024 14:37:31 +0100 Subject: [PATCH] set guest avatar for guests and emailguests in autocomplete knowing if a guest did not change it's name is not possible at this point, so we also show the letter "G" if it's name is guest Signed-off-by: Marcel Hibbe --- .../talk/adapters/items/MentionAutocompleteItem.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/MentionAutocompleteItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/MentionAutocompleteItem.kt index 5d7a8b2d8..3e3ba686f 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/MentionAutocompleteItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/MentionAutocompleteItem.kt @@ -17,6 +17,7 @@ import com.nextcloud.talk.R import com.nextcloud.talk.adapters.items.ParticipantItem.ParticipantItemViewHolder import com.nextcloud.talk.data.user.model.User import com.nextcloud.talk.extensions.loadFederatedUserAvatar +import com.nextcloud.talk.extensions.loadGuestAvatar import com.nextcloud.talk.extensions.loadUserAvatar import com.nextcloud.talk.models.json.mention.Mention import com.nextcloud.talk.models.json.status.StatusType @@ -146,9 +147,9 @@ class MentionAutocompleteItem( ) } - SOURCE_GUESTS -> { - run { avatarId = displayName } - run { holder.binding.avatarView.loadUserAvatar(currentUser, avatarId!!, true, false) } + SOURCE_GUESTS, SOURCE_EMAILS -> { + avatarId = displayName + holder.binding.avatarView.loadGuestAvatar(currentUser, avatarId!!, false) } else -> { @@ -217,6 +218,7 @@ class MentionAutocompleteItem( const val SOURCE_CALLS = "calls" const val SOURCE_GUESTS = "guests" const val SOURCE_GROUPS = "groups" + const val SOURCE_EMAILS = "emails" const val SOURCE_FEDERATION = "federated_users" } }