From 7d9cf77a039a7ce1fbceba65b48aa68c1404a242 Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Thu, 1 Aug 2024 11:03:19 +0300 Subject: [PATCH] Reverted back some changes.| #74 --- .../email/database/FlowCryptRoomDatabase.kt | 2 - .../email/database/entity/ThreadEntity.kt | 58 ------------------- 2 files changed, 60 deletions(-) delete mode 100644 FlowCrypt/src/main/java/com/flowcrypt/email/database/entity/ThreadEntity.kt diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/database/FlowCryptRoomDatabase.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/database/FlowCryptRoomDatabase.kt index e4457260e..76087e557 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/database/FlowCryptRoomDatabase.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/database/FlowCryptRoomDatabase.kt @@ -40,7 +40,6 @@ import com.flowcrypt.email.database.entity.LabelEntity import com.flowcrypt.email.database.entity.MessageEntity import com.flowcrypt.email.database.entity.PublicKeyEntity import com.flowcrypt.email.database.entity.RecipientEntity -import com.flowcrypt.email.database.entity.ThreadEntity import com.flowcrypt.email.extensions.kotlin.toInputStream import com.flowcrypt.email.security.KeyStoreCryptoManager import com.flowcrypt.email.security.pgp.PgpKey @@ -71,7 +70,6 @@ import java.util.UUID MessageEntity::class, PublicKeyEntity::class, AccountSettingsEntity::class, - ThreadEntity::class, ], version = FlowCryptRoomDatabase.DB_VERSION ) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/database/entity/ThreadEntity.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/database/entity/ThreadEntity.kt deleted file mode 100644 index c9f9650ae..000000000 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/database/entity/ThreadEntity.kt +++ /dev/null @@ -1,58 +0,0 @@ -/* - * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: denbond7 - */ - -package com.flowcrypt.email.database.entity - -import android.provider.BaseColumns -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.ForeignKey -import androidx.room.Index -import androidx.room.PrimaryKey - -/** - * @author Denys Bondarenko - */ -@Entity( - tableName = ThreadEntity.TABLE_NAME, - indices = [ - Index( - name = "account_account_type_in_threads", - value = ["account", "account_type"] - ), - Index( - name = "threadId_account_account_type_in_threads", - value = ["thread_id", "account", "account_type"], - unique = true - ) - ], - foreignKeys = [ - ForeignKey( - entity = AccountEntity::class, - parentColumns = ["email", "account_type"], - childColumns = ["account", "account_type"], - onDelete = ForeignKey.CASCADE - ) - ] -) -data class ThreadEntity( - @PrimaryKey(autoGenerate = true) @ColumnInfo(name = BaseColumns._ID) val id: Long? = null, - val account: String, - @ColumnInfo(name = "account_type", defaultValue = "NULL") val accountType: String? = null, - val folder: String, - @ColumnInfo(name = "thread_id", defaultValue = "NULL") val threadId: String? = null, - @ColumnInfo(name = "history_id", defaultValue = "NULL") val historyId: String? = null, - @ColumnInfo(defaultValue = "NULL") val subject: String? = null, - @ColumnInfo(defaultValue = "NULL") val addresses: String? = null, - @ColumnInfo(name = "date", defaultValue = "NULL") val date: Long? = null, - @ColumnInfo(name = "label_ids", defaultValue = "NULL") val labelIds: String? = null, - @ColumnInfo(name = "messages_count", defaultValue = "0") val messagesCount: Int = 0, - @ColumnInfo(name = "has_attachments", defaultValue = "0") val hasAttachments: Boolean = false, - @ColumnInfo(name = "has_pgp", defaultValue = "0") val hasPgp: Boolean = false, -) { - companion object { - const val TABLE_NAME = "threads" - } -} \ No newline at end of file