forked from upstream-mirrors/quik
#1234 - Mark conversation as read when archiving
This commit is contained in:
@@ -22,11 +22,15 @@ import com.moez.QKSMS.repository.ConversationRepository
|
|||||||
import io.reactivex.Flowable
|
import io.reactivex.Flowable
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class MarkArchived @Inject constructor(private val conversationRepo: ConversationRepository) : Interactor<List<Long>>() {
|
class MarkArchived @Inject constructor(
|
||||||
|
private val conversationRepo: ConversationRepository,
|
||||||
|
private val markRead: MarkRead
|
||||||
|
) : Interactor<List<Long>>() {
|
||||||
|
|
||||||
override fun buildObservable(params: List<Long>): Flowable<*> {
|
override fun buildObservable(params: List<Long>): Flowable<*> {
|
||||||
return Flowable.just(params.toLongArray())
|
return Flowable.just(params.toLongArray())
|
||||||
.doOnNext { threadIds -> conversationRepo.markArchived(*threadIds) }
|
.doOnNext { threadIds -> conversationRepo.markArchived(*threadIds) }
|
||||||
|
.flatMap { markRead.buildObservable(params) }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user