mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-12-19 15:14:28 +03:00
fix guests without name in lastMessage view in conversation list
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
b5a84b4a3f
commit
1b6d620915
1 changed files with 10 additions and 8 deletions
|
@ -20,6 +20,7 @@ import androidx.core.content.ContextCompat
|
|||
import androidx.core.content.res.ResourcesCompat
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.adapters.items.ConversationItem.ConversationItemViewHolder
|
||||
import com.nextcloud.talk.adapters.messages.MessagePayload
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
|
||||
import com.nextcloud.talk.chat.data.model.ChatMessage.MessageType
|
||||
import com.nextcloud.talk.data.database.mappers.asModel
|
||||
|
@ -249,14 +250,15 @@ class ConversationItem(
|
|||
} else if (model.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
|
||||
lastMessageDisplayText
|
||||
} else {
|
||||
val authorDisplayName =
|
||||
if (!TextUtils.isEmpty(chatMessage?.actorDisplayName)) {
|
||||
chatMessage?.actorDisplayName
|
||||
} else if ("guests" == chatMessage?.actorType) {
|
||||
val actorName = chatMessage?.actorDisplayName
|
||||
val authorDisplayName = if (!actorName.isNullOrBlank()) {
|
||||
actorName
|
||||
} else if ("guests" == chatMessage?.actorType || "emails" == chatMessage?.actorType) {
|
||||
appContext.getString(R.string.nc_guest)
|
||||
} else {
|
||||
""
|
||||
}
|
||||
|
||||
String.format(
|
||||
appContext.getString(R.string.nc_formatted_message),
|
||||
authorDisplayName,
|
||||
|
|
Loading…
Reference in a new issue