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 androidx.core.content.res.ResourcesCompat
|
||||||
import com.nextcloud.talk.R
|
import com.nextcloud.talk.R
|
||||||
import com.nextcloud.talk.adapters.items.ConversationItem.ConversationItemViewHolder
|
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.application.NextcloudTalkApplication.Companion.sharedApplication
|
||||||
import com.nextcloud.talk.chat.data.model.ChatMessage.MessageType
|
import com.nextcloud.talk.chat.data.model.ChatMessage.MessageType
|
||||||
import com.nextcloud.talk.data.database.mappers.asModel
|
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) {
|
} else if (model.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
|
||||||
lastMessageDisplayText
|
lastMessageDisplayText
|
||||||
} else {
|
} else {
|
||||||
val authorDisplayName =
|
val actorName = chatMessage?.actorDisplayName
|
||||||
if (!TextUtils.isEmpty(chatMessage?.actorDisplayName)) {
|
val authorDisplayName = if (!actorName.isNullOrBlank()) {
|
||||||
chatMessage?.actorDisplayName
|
actorName
|
||||||
} else if ("guests" == chatMessage?.actorType) {
|
} else if ("guests" == chatMessage?.actorType || "emails" == chatMessage?.actorType) {
|
||||||
appContext.getString(R.string.nc_guest)
|
appContext.getString(R.string.nc_guest)
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
|
|
||||||
String.format(
|
String.format(
|
||||||
appContext.getString(R.string.nc_formatted_message),
|
appContext.getString(R.string.nc_formatted_message),
|
||||||
authorDisplayName,
|
authorDisplayName,
|
||||||
|
|
Loading…
Reference in a new issue