Make sure note to self is included in backupsV2.

This commit is contained in:
Greyson Parrelli
2024-05-14 15:44:44 -04:00
committed by Nicholas Tinsley
parent 0465fdea62
commit 227a279131
9 changed files with 22 additions and 19 deletions

View File

@@ -53,7 +53,6 @@ internal class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
override fun onFirstEverAppLaunch() = Unit
override fun getKeysToIncludeInBackup(): List<String> = emptyList()
var canReadWriteToArchiveCdn: Boolean by booleanValue(KEY_CDN_CAN_READ_WRITE, false)
var restoreState: RestoreState by enumValue(KEY_RESTORE_STATE, RestoreState.NONE, RestoreState.serializer)
var optimizeStorage: Boolean by booleanValue(KEY_OPTIMIZE_STORAGE, false)
var backupWithCellular: Boolean by booleanValue(KEY_BACKUP_OVER_CELLULAR, false)
@@ -64,6 +63,11 @@ internal class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
val totalBackupSize: Long get() = lastBackupProtoSize + usedBackupMediaSpace
/** True if the user backs up media, otherwise false. */
val backsUpMedia: Boolean
@JvmName("backsUpMedia")
get() = backupTier == MessageBackupTier.PAID
var areBackupsEnabled: Boolean
get() {
return getBoolean(KEY_BACKUPS_ENABLED, false)
@@ -78,7 +82,7 @@ internal class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
}
val backupTier: MessageBackupTier? = if (areBackupsEnabled) {
if (canReadWriteToArchiveCdn) {
if (backsUpMedia) {
MessageBackupTier.PAID
} else {
MessageBackupTier.FREE