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 <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-11-20 14:37:31 +01:00
parent 02d0a65909
commit d95c1c605f
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B

View file

@ -17,6 +17,7 @@ import com.nextcloud.talk.R
import com.nextcloud.talk.adapters.items.ParticipantItem.ParticipantItemViewHolder import com.nextcloud.talk.adapters.items.ParticipantItem.ParticipantItemViewHolder
import com.nextcloud.talk.data.user.model.User import com.nextcloud.talk.data.user.model.User
import com.nextcloud.talk.extensions.loadFederatedUserAvatar import com.nextcloud.talk.extensions.loadFederatedUserAvatar
import com.nextcloud.talk.extensions.loadGuestAvatar
import com.nextcloud.talk.extensions.loadUserAvatar import com.nextcloud.talk.extensions.loadUserAvatar
import com.nextcloud.talk.models.json.mention.Mention import com.nextcloud.talk.models.json.mention.Mention
import com.nextcloud.talk.models.json.status.StatusType import com.nextcloud.talk.models.json.status.StatusType
@ -146,9 +147,9 @@ class MentionAutocompleteItem(
) )
} }
SOURCE_GUESTS -> { SOURCE_GUESTS, SOURCE_EMAILS -> {
run { avatarId = displayName } avatarId = displayName
run { holder.binding.avatarView.loadUserAvatar(currentUser, avatarId!!, true, false) } holder.binding.avatarView.loadGuestAvatar(currentUser, avatarId!!, false)
} }
else -> { else -> {
@ -217,6 +218,7 @@ class MentionAutocompleteItem(
const val SOURCE_CALLS = "calls" const val SOURCE_CALLS = "calls"
const val SOURCE_GUESTS = "guests" const val SOURCE_GUESTS = "guests"
const val SOURCE_GROUPS = "groups" const val SOURCE_GROUPS = "groups"
const val SOURCE_EMAILS = "emails"
const val SOURCE_FEDERATION = "federated_users" const val SOURCE_FEDERATION = "federated_users"
} }
} }