Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
66ae235a
Commit
66ae235a
authored
Apr 27, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show real name instead of username on chat list
parent
32e8e70f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
ChatRoomsPresenter.kt
...cket/android/chatrooms/presentation/ChatRoomsPresenter.kt
+3
-2
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+9
-1
No files found.
app/src/main/java/chat/rocket/android/chatrooms/presentation/ChatRoomsPresenter.kt
View file @
66ae235a
...
...
@@ -289,8 +289,9 @@ class ChatRoomsPresenter @Inject constructor(
private
suspend
fun
getChatRoomsWithPreviews
(
chatRooms
:
List
<
ChatRoom
>):
List
<
ChatRoom
>
{
return
chatRooms
.
map
{
if
(
it
.
lastMessage
!=
null
)
{
it
.
copy
(
lastMessage
=
viewModelMapper
.
map
(
it
.
lastMessage
!!
).
last
().
preview
)
val
lastMessage
=
it
.
lastMessage
if
(
lastMessage
!=
null
)
{
it
.
copy
(
lastMessage
=
viewModelMapper
.
map
(
lastMessage
).
last
().
preview
)
}
else
{
it
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
66ae235a
...
...
@@ -112,7 +112,15 @@ class ChatRoomsAdapter(private val context: Context,
}
private
fun
bindName
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
textView
.
textContent
=
chatRoom
.
name
textView
.
textContent
=
chatRoomName
(
chatRoom
)
}
private
fun
chatRoomName
(
chatRoom
:
ChatRoom
):
String
{
return
if
(
settings
.
useRealName
())
{
chatRoom
.
fullName
?:
chatRoom
.
name
}
else
{
chatRoom
.
name
}
}
private
fun
bindLastMessageDateTime
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment