mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-10 08:00:57 +00:00
fix guests without name for Mention autocomplete
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
1b6d620915
commit
6932ddff4b
@ -16,6 +16,7 @@ import androidx.core.content.res.ResourcesCompat
|
||||
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.loadDefaultAvatar
|
||||
import com.nextcloud.talk.extensions.loadFederatedUserAvatar
|
||||
import com.nextcloud.talk.extensions.loadGuestAvatar
|
||||
import com.nextcloud.talk.extensions.loadUserAvatar
|
||||
@ -56,7 +57,15 @@ class MentionAutocompleteItem(
|
||||
init {
|
||||
mentionId = mention.mentionId
|
||||
objectId = mention.id
|
||||
displayName = mention.label
|
||||
|
||||
displayName = if (!mention.label.isNullOrBlank()) {
|
||||
mention.label
|
||||
} else if ("guests" == mention.source || "emails" == mention.source) {
|
||||
context.resources.getString(R.string.nc_guest)
|
||||
} else {
|
||||
""
|
||||
}
|
||||
|
||||
source = mention.source
|
||||
status = mention.status
|
||||
statusIcon = mention.statusIcon
|
||||
@ -149,8 +158,12 @@ class MentionAutocompleteItem(
|
||||
|
||||
SOURCE_GUESTS, SOURCE_EMAILS -> {
|
||||
avatarId = displayName
|
||||
if (displayName.equals(context.resources.getString(R.string.nc_guest))) {
|
||||
holder.binding.avatarView.loadDefaultAvatar(viewThemeUtils)
|
||||
} else {
|
||||
holder.binding.avatarView.loadGuestAvatar(currentUser, avatarId!!, false)
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
holder.binding.avatarView.loadUserAvatar(currentUser, avatarId!!, true, false)
|
||||
|
Loading…
Reference in New Issue
Block a user