mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Improve message sync speed & reliability
This commit is contained in:
@@ -124,8 +124,6 @@ class CursorToMessageImpl @Inject constructor(
|
||||
?.let { EncodedStringValue(subjectCharset, it).string } ?: ""
|
||||
textContentType = ""
|
||||
attachmentType = Message.AttachmentType.NOT_LOADED
|
||||
|
||||
parts.addAll(cursorToPart.getPartsCursor(contentId)?.map { cursorToPart.map(it) } ?: listOf())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ class CursorToPartImpl @Inject constructor(private val context: Context) : Curso
|
||||
|
||||
override fun map(from: Cursor) = MmsPart().apply {
|
||||
id = from.getLong(from.getColumnIndexOrThrow(Telephony.Mms.Part._ID))
|
||||
messageId = from.getLong(from.getColumnIndexOrThrow(Telephony.Mms.Part.MSG_ID))
|
||||
type = from.getStringOrNull(from.getColumnIndexOrThrow(Telephony.Mms.Part.CONTENT_TYPE)) ?: "*/*"
|
||||
seq = from.getIntOrNull(from.getColumnIndexOrThrow(Telephony.Mms.Part.SEQ)) ?: -1
|
||||
name = from.getStringOrNull(from.getColumnIndexOrThrow(Telephony.Mms.Part.NAME))
|
||||
@@ -43,9 +44,8 @@ class CursorToPartImpl @Inject constructor(private val context: Context) : Curso
|
||||
text = from.getStringOrNull(from.getColumnIndexOrThrow(Telephony.Mms.Part.TEXT))
|
||||
}
|
||||
|
||||
override fun getPartsCursor(messageId: Long): Cursor? {
|
||||
return context.contentResolver.query(CONTENT_URI, null,
|
||||
"${Telephony.Mms.Part.MSG_ID} = ?", arrayOf(messageId.toString()), null)
|
||||
override fun getPartsCursor(): Cursor? {
|
||||
return context.contentResolver.query(CONTENT_URI, null, null, null, null)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user