Add support for archiving conversations

Archiving messages currently acts like recycle bin in
Simple Gallery, meaning that after 30 days, conversations
will be deleted permanently. Any updates to the conversation
(new messages) removes it from archive.

This closes #177
This commit is contained in:
Ensar Sarajčić 2023-07-11 16:52:47 +02:00
parent 9942fb788a
commit 47861f605d
22 changed files with 846 additions and 191 deletions

View file

@ -91,4 +91,12 @@ class Config(context: Context) : BaseConfig(context) {
var keyboardHeight: Int
get() = prefs.getInt(SOFT_KEYBOARD_HEIGHT, context.getDefaultKeyboardHeight())
set(keyboardHeight) = prefs.edit().putInt(SOFT_KEYBOARD_HEIGHT, keyboardHeight).apply()
var useArchive: Boolean
get() = prefs.getBoolean(USE_ARCHIVE, true)
set(useArchive) = prefs.edit().putBoolean(USE_ARCHIVE, useArchive).apply()
var lastArchiveCheck: Long
get() = prefs.getLong(LAST_ARCHIVE_CHECK, 0L)
set(lastArchiveCheck) = prefs.edit().putLong(LAST_ARCHIVE_CHECK, lastArchiveCheck).apply()
}

View file

@ -37,6 +37,8 @@ const val SCHEDULED_MESSAGE_ID = "scheduled_message_id"
const val SOFT_KEYBOARD_HEIGHT = "soft_keyboard_height"
const val IS_MMS = "is_mms"
const val MESSAGE_ID = "message_id"
const val USE_ARCHIVE = "use_recycle_bin"
const val LAST_ARCHIVE_CHECK = "last_bin_check"
private const val PATH = "com.simplemobiletools.smsmessenger.action."
const val MARK_AS_READ = PATH + "mark_as_read"