feat: use models during export, try to update conversation date during import

This commit is contained in:
darthpaul 2021-09-18 21:05:06 +01:00
parent e10a410788
commit d78776e288
11 changed files with 216 additions and 149 deletions

View file

@ -3,8 +3,6 @@ package com.simplemobiletools.smsmessenger.models
import com.google.gson.annotations.SerializedName
data class ExportedMessage(
@SerializedName("threadId")
val threadId: Long,
@SerializedName("sms")
val sms: List<SmsBackup>,
@SerializedName("mms")

View file

@ -8,8 +8,6 @@ import com.google.gson.annotations.SerializedName
data class MmsAddress(
@SerializedName("address")
val address: String,
@SerializedName("msg_id")
val msgId: Int,
@SerializedName("type")
val type: Int,
@SerializedName("charset")

View file

@ -18,8 +18,6 @@ data class MmsBackup(
val dateSent: Long,
@SerializedName("locked")
val locked: Int,
@SerializedName("m_id")
val messageId: String?,
@SerializedName("m_type")
val messageType: Int,
@SerializedName("msg_box")
@ -40,14 +38,12 @@ data class MmsBackup(
val subjectCharSet: String?,
@SerializedName("sub_id")
val subscriptionId: Long,
@SerializedName("thread_id")
val threadId: Long,
@SerializedName("tr_id")
val transactionId: String?,
@SerializedName("addresses")
val addresses: List<MmsAddress>,
@SerializedName("parts")
val mmsParts: List<MmsPart>,
val parts: List<MmsPart>,
) {
fun toContentValues(): ContentValues {

View file

@ -20,22 +20,16 @@ data class MmsPart(
val ctStart: String?,
@SerializedName("ctt_t")
val ctType: String?,
@SerializedName("_data")
val `data`: String?,
@SerializedName("fn")
val filename: String?,
@SerializedName("_id")
val id: Long,
@SerializedName("mid")
val messageId: Long,
@SerializedName("name")
val name: String,
val name: String?,
@SerializedName("seq")
val sequenceOrder: Int,
@SerializedName("text")
val text: String?,
@SerializedName("mms_content")
val mmsContent: String?,
@SerializedName("data")
val data: String?,
) {
fun toContentValues(): ContentValues {

View file

@ -7,14 +7,12 @@ import androidx.core.content.contentValuesOf
import com.google.gson.annotations.SerializedName
data class SmsBackup(
@SerializedName("thread_id")
val threadId: Long,
@SerializedName("sub_id")
val subscriptionId: Long,
@SerializedName("address")
val address: String,
@SerializedName("body")
val body: String,
val body: String?,
@SerializedName("date")
val date: Long,
@SerializedName("date_sent")
@ -35,7 +33,6 @@ data class SmsBackup(
fun toContentValues(): ContentValues {
return contentValuesOf(
Telephony.Sms.THREAD_ID to threadId,
Telephony.Sms.SUBSCRIPTION_ID to subscriptionId,
Telephony.Sms.ADDRESS to address,
Telephony.Sms.BODY to body,