Loading data/src/main/java/com/moez/QKSMS/mapper/CursorToPartImpl.kt +6 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,12 @@ class CursorToPartImpl @Inject constructor(private val context: Context) : Curso text = from.getStringOrNull(from.getColumnIndexOrThrow(Telephony.Mms.Part.TEXT)) } override fun getPartsCursor(): Cursor? { return context.contentResolver.query(CONTENT_URI, null, null, null, null) override fun getPartsCursor(messageId: Long?): Cursor? { return when (messageId) { null -> context.contentResolver.query(CONTENT_URI, null, null, null, null) else -> context.contentResolver.query(CONTENT_URI, null, "${Telephony.Mms.Part.MSG_ID} = ?", arrayOf(messageId.toString()), null) } } } data/src/main/java/com/moez/QKSMS/repository/SyncRepositoryImpl.kt +6 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,12 @@ class SyncRepositoryImpl @Inject constructor( cursorToMessage.map(Pair(cursor, columnsMap)).apply { existingId?.let { this.id = it } if (isMms()) { parts = RealmList<MmsPart>().apply { addAll(cursorToPart.getPartsCursor(contentId)?.map { cursorToPart.map(it) }.orEmpty()) } } conversationRepo.getOrCreateConversation(threadId) insertOrUpdate() } Loading domain/src/main/java/com/moez/QKSMS/mapper/CursorToPart.kt +1 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,6 @@ import com.moez.QKSMS.model.MmsPart interface CursorToPart : Mapper<Cursor, MmsPart> { fun getPartsCursor(): Cursor? fun getPartsCursor(messageId: Long? = null): Cursor? } Loading
data/src/main/java/com/moez/QKSMS/mapper/CursorToPartImpl.kt +6 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,12 @@ class CursorToPartImpl @Inject constructor(private val context: Context) : Curso text = from.getStringOrNull(from.getColumnIndexOrThrow(Telephony.Mms.Part.TEXT)) } override fun getPartsCursor(): Cursor? { return context.contentResolver.query(CONTENT_URI, null, null, null, null) override fun getPartsCursor(messageId: Long?): Cursor? { return when (messageId) { null -> context.contentResolver.query(CONTENT_URI, null, null, null, null) else -> context.contentResolver.query(CONTENT_URI, null, "${Telephony.Mms.Part.MSG_ID} = ?", arrayOf(messageId.toString()), null) } } }
data/src/main/java/com/moez/QKSMS/repository/SyncRepositoryImpl.kt +6 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,12 @@ class SyncRepositoryImpl @Inject constructor( cursorToMessage.map(Pair(cursor, columnsMap)).apply { existingId?.let { this.id = it } if (isMms()) { parts = RealmList<MmsPart>().apply { addAll(cursorToPart.getPartsCursor(contentId)?.map { cursorToPart.map(it) }.orEmpty()) } } conversationRepo.getOrCreateConversation(threadId) insertOrUpdate() } Loading
domain/src/main/java/com/moez/QKSMS/mapper/CursorToPart.kt +1 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,6 @@ import com.moez.QKSMS.model.MmsPart interface CursorToPart : Mapper<Cursor, MmsPart> { fun getPartsCursor(): Cursor? fun getPartsCursor(messageId: Long? = null): Cursor? }