Commit 35decfd6 authored by Lucio Maciel's avatar Lucio Maciel

Fix Fullname on chatrooms screen

parent f9eaeab5
......@@ -68,13 +68,15 @@ class RoomUiModelMapper(
val name = mapName(user.username!!, user.name, false)
val status = user.status
val avatar = serverUrl.avatarUrl(user.username!!)
val username = user.username!!
RoomUiModel(
id = user.id,
name = name,
type = roomTypeOf(RoomType.DIRECT_MESSAGE),
avatar = avatar,
status = status
status = status,
username = username
)
}
}
......@@ -97,7 +99,7 @@ class RoomUiModelMapper(
val isUnread = alert || unread > 0
val type = roomTypeOf(type)
val status = chatRoom.status?.let { userStatusOf(it) }
val roomName = mapName(name, chatRoom.userFullname, isUnread)
val roomName = mapName(name, fullname, isUnread)
val timestamp = mapDate(lastMessageTimestamp ?: updatedAt, isUnread)
val avatar = if (type is RoomType.DirectMessage) {
serverUrl.avatarUrl(name)
......@@ -117,7 +119,8 @@ class RoomUiModelMapper(
unread = unread,
alert = isUnread,
lastMessage = lastMessage,
status = status
status = status,
username = if (type is RoomType.DirectMessage) name else null
)
}
}
......
......@@ -12,5 +12,6 @@ data class RoomUiModel(
val unread: String? = null,
val alert: Boolean = false,
val lastMessage: CharSequence? = null,
val status: UserStatus? = null
val status: UserStatus? = null,
val username: String? = null
)
\ No newline at end of file
......@@ -51,7 +51,8 @@ class ChatRoomsPresenter @Inject constructor(
id = id,
subscriptionId = "",
type = type.toString(),
name = name.toString(),
name = username ?: name.toString(),
fullname = name.toString(),
open = false
)
loadChatRoom(entity)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment