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

Fix Fullname on chatrooms screen

parent f9eaeab5
...@@ -68,13 +68,15 @@ class RoomUiModelMapper( ...@@ -68,13 +68,15 @@ class RoomUiModelMapper(
val name = mapName(user.username!!, user.name, false) val name = mapName(user.username!!, user.name, false)
val status = user.status val status = user.status
val avatar = serverUrl.avatarUrl(user.username!!) val avatar = serverUrl.avatarUrl(user.username!!)
val username = user.username!!
RoomUiModel( RoomUiModel(
id = user.id, id = user.id,
name = name, name = name,
type = roomTypeOf(RoomType.DIRECT_MESSAGE), type = roomTypeOf(RoomType.DIRECT_MESSAGE),
avatar = avatar, avatar = avatar,
status = status status = status,
username = username
) )
} }
} }
...@@ -97,7 +99,7 @@ class RoomUiModelMapper( ...@@ -97,7 +99,7 @@ class RoomUiModelMapper(
val isUnread = alert || unread > 0 val isUnread = alert || unread > 0
val type = roomTypeOf(type) val type = roomTypeOf(type)
val status = chatRoom.status?.let { userStatusOf(it) } 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 timestamp = mapDate(lastMessageTimestamp ?: updatedAt, isUnread)
val avatar = if (type is RoomType.DirectMessage) { val avatar = if (type is RoomType.DirectMessage) {
serverUrl.avatarUrl(name) serverUrl.avatarUrl(name)
...@@ -117,7 +119,8 @@ class RoomUiModelMapper( ...@@ -117,7 +119,8 @@ class RoomUiModelMapper(
unread = unread, unread = unread,
alert = isUnread, alert = isUnread,
lastMessage = lastMessage, lastMessage = lastMessage,
status = status status = status,
username = if (type is RoomType.DirectMessage) name else null
) )
} }
} }
......
...@@ -12,5 +12,6 @@ data class RoomUiModel( ...@@ -12,5 +12,6 @@ data class RoomUiModel(
val unread: String? = null, val unread: String? = null,
val alert: Boolean = false, val alert: Boolean = false,
val lastMessage: CharSequence? = null, 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( ...@@ -51,7 +51,8 @@ class ChatRoomsPresenter @Inject constructor(
id = id, id = id,
subscriptionId = "", subscriptionId = "",
type = type.toString(), type = type.toString(),
name = name.toString(), name = username ?: name.toString(),
fullname = name.toString(),
open = false open = false
) )
loadChatRoom(entity) 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