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
7760bd1a
Commit
7760bd1a
authored
Aug 25, 2018
by
Kiryl Vashyla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync date saving updated, checked on device
parent
9f281645
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+5
-4
No files found.
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
7760bd1a
...
@@ -229,10 +229,11 @@ class ChatRoomPresenter @Inject constructor(
...
@@ -229,10 +229,11 @@ class ChatRoomPresenter @Inject constructor(
//if success - saving last synced time
//if success - saving last synced time
if
(
messages
.
isEmpty
())
{
if
(
messages
.
isEmpty
())
{
//chat history is empty - just saving current date
messagesRepository
.
saveLastSyncDate
(
System
.
currentTimeMillis
())
messagesRepository
.
saveLastSyncDate
(
System
.
currentTimeMillis
())
}
else
{
}
else
{
//
TODO sort
//
assume that BE returns ordered messages, the first message is the latest one
messagesRepository
.
saveLastSyncDate
(
messages
.
la
st
().
timestamp
)
messagesRepository
.
saveLastSyncDate
(
messages
.
fir
st
().
timestamp
)
}
}
view
.
showMessages
(
view
.
showMessages
(
...
@@ -529,8 +530,8 @@ class ChatRoomPresenter @Inject constructor(
...
@@ -529,8 +530,8 @@ class ChatRoomPresenter @Inject constructor(
))
))
messagesRepository
.
saveAll
(
messages
.
result
)
messagesRepository
.
saveAll
(
messages
.
result
)
//if success - saving last synced time
//if success - saving last synced time
//
TODO sort and peek the latest dat
e
//
assume that BE returns ordered messages, the first message is the latest on
e
messagesRepository
.
saveLastSyncDate
(
messages
.
result
.
la
st
().
timestamp
)
messagesRepository
.
saveLastSyncDate
(
messages
.
result
.
fir
st
().
timestamp
)
launchUI
(
strategy
)
{
launchUI
(
strategy
)
{
view
.
showNewMessage
(
models
,
true
)
view
.
showNewMessage
(
models
,
true
)
...
...
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