Commit 645a32f3 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Call keep alive only if not succeded and cap room messages fetch count to 50 instead of 100

parent 1a43611e
......@@ -77,7 +77,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
success -> {
if (success) {
if (!success) {
connectivityManagerApi.keepAliveServer();
}
},
......@@ -89,14 +89,13 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
public void loadMoreMessages() {
final Disposable subscription = getSingleRoom()
.flatMap(messageInteractor::loadMoreMessages)
.subscribeOn(AndroidSchedulers.from(BackgroundLooper.get()))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
success -> {
if (success) {
if (!success) {
connectivityManagerApi.keepAliveServer();
}
},
......
......@@ -19,7 +19,7 @@ class MessageInteractor(private val messageRepository: MessageRepository,
val roomHistoryState = RoomHistoryState.builder()
.setRoomId(room.roomId)
.setSyncState(SyncState.NOT_SYNCED)
.setCount(100)
.setCount(50)
.setReset(true)
.setComplete(false)
.setTimestamp(0)
......
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