mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-04 20:34:14 +01:00
Do not respect optimized media setting from primary on link+sync.
This commit is contained in:
@@ -1338,7 +1338,7 @@ object BackupRepository {
|
||||
SignalDatabase.recipients.setProfileKey(selfId, selfData.profileKey)
|
||||
SignalDatabase.recipients.setProfileSharing(selfId, true)
|
||||
|
||||
val importState = ImportState(mediaRootBackupKey)
|
||||
val importState = ImportState(mediaRootBackupKey, backupMode)
|
||||
val chatItemInserter: ChatItemArchiveImporter = ChatItemArchiveProcessor.beginImport(importState)
|
||||
|
||||
Log.d(TAG, "[import] Beginning to read frames.")
|
||||
@@ -2530,7 +2530,7 @@ class ExportState(
|
||||
var releaseNoteRecipientId: Long? = null
|
||||
}
|
||||
|
||||
class ImportState(val mediaRootBackupKey: MediaRootBackupKey) {
|
||||
class ImportState(val mediaRootBackupKey: MediaRootBackupKey, val backupMode: BackupMode) {
|
||||
val remoteToLocalRecipientId: MutableMap<Long, RecipientId> = hashMapOf()
|
||||
val chatIdToLocalThreadId: MutableMap<Long, Long> = hashMapOf()
|
||||
val chatIdToLocalRecipientId: MutableMap<Long, RecipientId> = hashMapOf()
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ object AccountDataArchiveProcessor {
|
||||
SignalStore.story.isFeatureDisabled = settings.storiesDisabled
|
||||
SignalStore.story.userHasSeenGroupStoryEducationSheet = settings.hasSeenGroupStoryEducationSheet
|
||||
SignalStore.story.viewedReceiptsEnabled = settings.storyViewReceiptsEnabled ?: settings.readReceipts
|
||||
SignalStore.backup.optimizeStorage = settings.optimizeOnDeviceStorage
|
||||
SignalStore.backup.optimizeStorage = !importState.backupMode.isLinkAndSync && settings.optimizeOnDeviceStorage
|
||||
SignalStore.backup.backupTier = MessageBackupTier.fromBackupLevel(settings.backupTier)
|
||||
SignalStore.settings.sentMediaQuality = settings.defaultSentMediaQuality.toLocalSentMediaQuality()
|
||||
SignalStore.settings.setTheme(settings.appTheme.toLocalTheme())
|
||||
|
||||
@@ -31,6 +31,11 @@ class RestoreOptimizedMediaJob private constructor(parameters: Parameters) : Job
|
||||
|
||||
@JvmStatic
|
||||
fun enqueueIfNecessary() {
|
||||
if (SignalStore.account.isLinkedDevice && SignalStore.backup.optimizeStorage) {
|
||||
Log.w(TAG, "Storage optimization is not supported on linked devices. Disabling and restoring all media.")
|
||||
SignalStore.backup.optimizeStorage = false
|
||||
}
|
||||
|
||||
if (SignalStore.backup.backsUpMedia && !SignalStore.backup.optimizeStorage) {
|
||||
AppDependencies.jobManager.add(RestoreOptimizedMediaJob())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user