Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3aba9282 authored by moezbhatti's avatar moezbhatti
Browse files

Mark read when blocking conversation

parent 07f7d0b7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -22,11 +22,15 @@ import com.moez.QKSMS.repository.ConversationRepository
import io.reactivex.Flowable
import javax.inject.Inject

class MarkBlocked @Inject constructor(private val conversationRepo: ConversationRepository) : Interactor<List<Long>>() {
class MarkBlocked @Inject constructor(
    private val conversationRepo: ConversationRepository,
    private val markRead: MarkRead
) : Interactor<List<Long>>() {

    override fun buildObservable(params: List<Long>): Flowable<*> {
        return Flowable.just(params.toLongArray())
                .doOnNext { threadIds -> conversationRepo.markBlocked(*threadIds) }
                .flatMap { markRead.buildObservable(params) }
    }

}
 No newline at end of file