forked from upstream-mirrors/quik
store recipient model instead of recipients string in conversation
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package com.moez.QKSMS.data.sync
|
||||
|
||||
import android.net.Uri
|
||||
|
||||
class RecipientColumns {
|
||||
|
||||
companion object {
|
||||
val URI = Uri.parse("content://mms-sms/canonical-address/")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,7 +32,7 @@ internal object SyncManager {
|
||||
.flatMap { cursor -> cursor.asFlowable() }
|
||||
.map { cursor -> Conversation(cursor) }
|
||||
.distinct { conversation -> conversation.id }
|
||||
.doOnNext { conversation -> realm?.insert(conversation) }
|
||||
.doOnNext { conversation -> realm?.insertOrUpdate(conversation) }
|
||||
.map { conversation -> conversation.id }
|
||||
.concatMap { threadId ->
|
||||
val uri = Uri.withAppendedPath(MessageColumns.URI, threadId.toString())
|
||||
@@ -42,7 +42,7 @@ internal object SyncManager {
|
||||
}
|
||||
.filter { message -> message.type == "sms" || message.type == "mms" }
|
||||
.distinct { message -> message.id }
|
||||
.doOnNext { message -> realm?.insert(message) }
|
||||
.doOnNext { message -> realm?.insertOrUpdate(message) }
|
||||
.count()
|
||||
.toFlowable()
|
||||
.doOnNext {
|
||||
|
||||
Reference in New Issue
Block a user