Unverified Commit ed5e1d19 authored by Lucio Maciel's avatar Lucio Maciel Committed by GitHub

Merge pull request #1501 from RocketChat/fix/fix-fullname-on-chatrooms

[FIX] fix fullname on chatrooms
parents 107e5f7c 35decfd6
......@@ -251,10 +251,18 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
override fun onPause() {
super.onPause()
setReactionButtonIcon(R.drawable.ic_reaction_24dp)
emojiKeyboardPopup.dismiss()
dismissEmojiKeyboard()
activity?.invalidateOptionsMenu()
}
private fun dismissEmojiKeyboard() {
// Check if the keyboard was ever initialized.
// It may be the case when you are looking a not joined room
if (::emojiKeyboardPopup.isInitialized) {
emojiKeyboardPopup.dismiss()
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
if (resultData != null && resultCode == Activity.RESULT_OK) {
when (requestCode) {
......
......@@ -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