Skip to content
Snippets Groups Projects
Commit 00016c0d authored by Adrien Béraud's avatar Adrien Béraud
Browse files

conversation: read messages from computation thread

Change-Id: I2f2ccdafd4a9bfcd9fa7ce9f8bd78ea847907b43
parent 1ba501ca
Branches
Tags
No related merge requests found
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
*/ */
package net.jami.conversation package net.jami.conversation
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Scheduler import io.reactivex.rxjava3.core.Scheduler
import io.reactivex.rxjava3.core.Single
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
import io.reactivex.rxjava3.subjects.BehaviorSubject import io.reactivex.rxjava3.subjects.BehaviorSubject
...@@ -117,8 +119,12 @@ class ConversationPresenter @Inject constructor( ...@@ -117,8 +119,12 @@ class ConversationPresenter @Inject constructor(
.subscribe({ conversation: Conversation -> .subscribe({ conversation: Conversation ->
conversation.isVisible = true conversation.isVisible = true
conversation.isBubble = isBubble conversation.isBubble = isBubble
mCompositeDisposable.add(Completable.fromAction {
accountService.getAccount(conversation.accountId)?.let { account -> accountService.getAccount(conversation.accountId)?.let { account ->
conversationFacade.readMessages(account, conversation, !isBubble)} conversationFacade.readMessages(account, conversation, !isBubble)}
}
.subscribeOn(Schedulers.computation())
.subscribe())
}) { e -> Log.e(TAG, "Error loading conversation", e) }) }) { e -> Log.e(TAG, "Error loading conversation", e) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment