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
392faa90
Commit
392faa90
authored
Mar 31, 2018
by
Shailesh Baldaniya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Grouping for Live Chat
parent
d0ce271b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
ChatRoomsPresenter.kt
...cket/android/chatrooms/presentation/ChatRoomsPresenter.kt
+1
-4
Constants.kt
app/src/main/java/chat/rocket/android/helper/Constants.kt
+1
-0
No files found.
app/src/main/java/chat/rocket/android/chatrooms/presentation/ChatRoomsPresenter.kt
View file @
392faa90
...
...
@@ -205,10 +205,6 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
}
}
private
fun
compareBy
(
selector
:
KProperty
<
Message
?
>):
Comparator
<
ChatRoom
>
{
return
Comparator
{
a
,
b
->
(
a
.
lastMessage
?.
timestamp
!!
-
b
.
lastMessage
?.
timestamp
!!
).
toInt
()
}
}
private
fun
compareBy
(
selector
:
KProperty1
<
ChatRoom
,
RoomType
>):
Comparator
<
ChatRoom
>
{
return
Comparator
{
a
,
b
->
getTypeConstant
(
a
.
type
)
-
getTypeConstant
(
b
.
type
)
}
}
...
...
@@ -218,6 +214,7 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
is
RoomType
.
Channel
->
Constants
.
CHATROOM_CHANNEL
is
RoomType
.
PrivateGroup
->
Constants
.
CHATROOM_PRIVATE_GROUP
is
RoomType
.
DirectMessage
->
Constants
.
CHATROOM_DM
is
RoomType
.
Livechat
->
Constants
.
CHATROOM_LIVE_CHAT
else
->
0
}
}
...
...
app/src/main/java/chat/rocket/android/helper/Constants.kt
View file @
392faa90
...
...
@@ -9,6 +9,7 @@ object Constants {
const
val
CHATROOM_CHANNEL
=
0
const
val
CHATROOM_PRIVATE_GROUP
=
1
const
val
CHATROOM_DM
=
2
const
val
CHATROOM_LIVE_CHAT
=
3
}
object
ChatRoomsSortOrder
{
...
...
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