fix: add missing projection and fix typo error (#571)

* fix: add missing subject projection column

* fix: drop the simple view

* fix: drop the message count filter
This commit is contained in:
Naveen Singh 2026-01-23 05:52:33 +05:30 committed by GitHub
parent fffe72b367
commit dd4ff67a72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -478,12 +478,10 @@ private fun Context.queryCursorUnsafe(
}
fun Context.getConversationIds(): List<Long> {
val uri = "${Threads.CONTENT_URI}?simple=true".toUri()
val projection = arrayOf(Threads._ID)
val selection = "${Threads.MESSAGE_COUNT} > 0"
val sortOrder = "${Threads.DATE} ASC"
val conversationIds = mutableListOf<Long>()
queryCursor(uri, projection, selection, null, sortOrder, true) { cursor ->
queryCursor(Threads.CONTENT_URI, projection, null, null, sortOrder, true) { cursor ->
val id = cursor.getLongValue(Threads._ID)
conversationIds.add(id)
}

View file

@ -70,7 +70,7 @@ class MessagesReader(private val context: Context) {
val body = cursor.getStringValueOrNull(Sms.BODY)
val date = cursor.getLongValue(Sms.DATE)
val dateSent = cursor.getLongValue(Sms.DATE_SENT)
val locked = cursor.getIntValue(Sms.DATE_SENT)
val locked = cursor.getIntValue(Sms.LOCKED)
val protocol = cursor.getStringValueOrNull(Sms.PROTOCOL)
val read = cursor.getIntValue(Sms.READ)
val status = cursor.getIntValue(Sms.STATUS)
@ -115,6 +115,7 @@ class MessagesReader(private val context: Context) {
Mms.SEEN,
Mms.TEXT_ONLY,
Mms.STATUS,
Mms.SUBJECT,
Mms.SUBJECT_CHARSET,
Mms.SUBSCRIPTION_ID,
Mms.TRANSACTION_ID