reset messages at app upgrade

This commit is contained in:
tibbi 2022-06-29 14:27:37 +02:00
parent 9af293a4b5
commit 30399df77f
3 changed files with 13 additions and 8 deletions

View File

@ -83,14 +83,7 @@ class MainActivity : SimpleActivity() {
}
}
// fix a glitch at enabling Release version minifying from 5.12.3
// reset messages in 5.14.3 again, as PhoneNumber is no longer minified
if (!config.wasDbCleared) {
ensureBackgroundThread {
messagesDB.deleteAll()
}
config.wasDbCleared = true
}
clearAllMessagesIfNeeded()
}
override fun onResume() {

View File

@ -92,6 +92,7 @@ class ThreadActivity : SimpleActivity() {
return
}
clearAllMessagesIfNeeded()
threadId = intent.getLongExtra(THREAD_ID, 0L)
intent.getStringExtra(THREAD_TITLE)?.let {
supportActionBar?.title = it

View File

@ -982,3 +982,14 @@ fun Context.getSendMessageSettings(): Settings {
settings.group = config.sendGroupMessageMMS
return settings
}
// fix a glitch at enabling Release version minifying from 5.12.3
// reset messages in 5.14.3 again, as PhoneNumber is no longer minified
fun Context.clearAllMessagesIfNeeded() {
if (!config.wasDbCleared) {
ensureBackgroundThread {
messagesDB.deleteAll()
}
config.wasDbCleared = true
}
}