Split lines in MessagesReader

This commit is contained in:
merkost 2023-07-22 00:14:55 +10:00
parent c72dc199aa
commit 842368d0f4
1 changed files with 12 additions and 4 deletions

View File

@ -17,9 +17,7 @@ import java.io.InputStream
class MessagesReader(private val context: Context) { class MessagesReader(private val context: Context) {
fun getMessagesToExport( fun getMessagesToExport(
getSms: Boolean, getSms: Boolean, getMms: Boolean, callback: (messages: List<MessagesBackup>) -> Unit
getMms: Boolean,
callback: (messages: List<MessagesBackup>) -> Unit
) { ) {
val conversationIds = context.getConversationIds() val conversationIds = context.getConversationIds()
var smsMessages = listOf<SmsBackup>() var smsMessages = listOf<SmsBackup>()
@ -36,7 +34,17 @@ class MessagesReader(private val context: Context) {
private fun getSmsMessages(threadIds: List<Long>): List<SmsBackup> { private fun getSmsMessages(threadIds: List<Long>): List<SmsBackup> {
val projection = arrayOf( val projection = arrayOf(
Sms.SUBSCRIPTION_ID, Sms.ADDRESS, Sms.BODY, Sms.DATE, Sms.DATE_SENT, Sms.LOCKED, Sms.PROTOCOL, Sms.READ, Sms.STATUS, Sms.TYPE, Sms.SERVICE_CENTER Sms.SUBSCRIPTION_ID,
Sms.ADDRESS,
Sms.BODY,
Sms.DATE,
Sms.DATE_SENT,
Sms.LOCKED,
Sms.PROTOCOL,
Sms.READ,
Sms.STATUS,
Sms.TYPE,
Sms.SERVICE_CENTER
) )
val selection = "${Sms.THREAD_ID} = ?" val selection = "${Sms.THREAD_ID} = ?"