Allow for nullable cursor when syncing message

This commit is contained in:
Moez Bhatti
2018-04-06 17:49:27 -04:00
parent 2a638d29a3
commit 7779ed219d
4 changed files with 22 additions and 17 deletions
@@ -38,7 +38,7 @@ class ReceiveMms @Inject constructor(
override fun buildObservable(params: Uri): Flowable<*> {
return Flowable.just(params)
.flatMap { uri -> syncManager.syncMessage(uri) } // Sync the message
.mapNotNull { uri -> syncManager.syncMessage(uri) } // Sync the message
.filter { message ->
// Because we use the smsmms library for receiving and storing MMS, we'll need
// to check if it should be blocked after we've pulled it into realm. If it
@@ -22,13 +22,14 @@ import android.net.Uri
import io.reactivex.Flowable
import model.Message
import repository.SyncRepository
import util.extensions.mapNotNull
import javax.inject.Inject
class SyncMessage @Inject constructor(private val syncManager: SyncRepository) : Interactor<Uri>() {
override fun buildObservable(params: Uri): Flowable<Message> {
return Flowable.just(params)
.flatMap { uri -> syncManager.syncMessage(uri) }
.mapNotNull { uri -> syncManager.syncMessage(uri) }
}
}