Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,28 @@ abstract class DelMessageDatabase : RoomDatabase() {
}
}

private val MIGRATION_5_6 = object : Migration(5, 6) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL(
"CREATE TABLE IF NOT EXISTS deleted_for_me (" +
"_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
"key_id TEXT, " +
"chat_jid TEXT, " +
"sender_jid TEXT, " +
"timestamp INTEGER, " +
"original_timestamp INTEGER DEFAULT 0, " +
"media_type INTEGER, " +
"text_content TEXT, " +
"media_path TEXT, " +
"media_caption TEXT, " +
"is_from_me INTEGER DEFAULT 0, " +
"contact_name TEXT, " +
"package_name TEXT, " +
"UNIQUE(key_id, chat_jid))"
)
}
}

private val MIGRATION_6_7 = object : Migration(6, 7) {
override fun migrate(db: SupportSQLiteDatabase) {
try {
Expand Down Expand Up @@ -146,6 +168,7 @@ abstract class DelMessageDatabase : RoomDatabase() {
.addMigrations(
MIGRATION_1_4,
MIGRATION_4_6,
MIGRATION_5_6,
MIGRATION_6_7,
MIGRATION_7_8,
MIGRATION_8_9,
Expand All @@ -160,4 +183,4 @@ abstract class DelMessageDatabase : RoomDatabase() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ class AntiRevoke(loader: ClassLoader, preferences: XSharedPreferences) :
antirevokeType: String
) {
if (dateTextView == null) return
val antirevokeValue = prefs.getString(antirevokeType, "0")?.toIntOrNull() ?: 0
if (antirevokeValue == 0) return

val key = fMessage.key
val messageRevokedList = getRevokedMessagesForJid(fMessage)
Expand Down Expand Up @@ -205,8 +207,6 @@ class AntiRevoke(loader: ClassLoader, preferences: XSharedPreferences) :
}
}

val antirevokeValue = prefs.getString(antirevokeType, "0")?.toIntOrNull() ?: 0

when (antirevokeValue) {
1 -> {
val messageText = originalMessage ?: dateTextView.text
Expand Down Expand Up @@ -330,4 +330,4 @@ class AntiRevoke(loader: ClassLoader, preferences: XSharedPreferences) :
}

override fun getPluginName(): String = "Anti Revoke"
}
}
Loading