mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-20 08:45:50 +01:00
Never sync trim deletes from linked devices.
This commit is contained in:
+8
-6
@@ -334,12 +334,14 @@ private fun ManageStorageSettingsScreen(
|
||||
onClick = onSetChatLengthLimit
|
||||
)
|
||||
|
||||
Rows.ToggleRow(
|
||||
text = stringResource(id = R.string.ManageStorageSettingsFragment_apply_limits_title),
|
||||
label = stringResource(id = R.string.ManageStorageSettingsFragment_apply_limits_description),
|
||||
checked = state.syncTrimDeletes,
|
||||
onCheckChanged = onSyncTrimThreadDeletes
|
||||
)
|
||||
if (state.isPrimary) {
|
||||
Rows.ToggleRow(
|
||||
text = stringResource(id = R.string.ManageStorageSettingsFragment_apply_limits_title),
|
||||
label = stringResource(id = R.string.ManageStorageSettingsFragment_apply_limits_description),
|
||||
checked = state.syncTrimDeletes,
|
||||
onCheckChanged = onSyncTrimThreadDeletes
|
||||
)
|
||||
}
|
||||
|
||||
Dividers.Default()
|
||||
|
||||
|
||||
+4
-2
@@ -36,7 +36,8 @@ class ManageStorageSettingsViewModel : ViewModel() {
|
||||
keepMessagesDuration = SignalStore.settings.keepMessagesDuration,
|
||||
lengthLimit = if (SignalStore.settings.isTrimByLengthEnabled) SignalStore.settings.threadTrimLength else ManageStorageState.NO_LIMIT,
|
||||
syncTrimDeletes = SignalStore.settings.shouldSyncThreadTrimDeletes(),
|
||||
localBackupsEnabled = SignalStore.backup.newLocalBackupsEnabled
|
||||
localBackupsEnabled = SignalStore.backup.newLocalBackupsEnabled,
|
||||
isPrimary = SignalStore.account.isPrimaryDevice
|
||||
)
|
||||
)
|
||||
val state = store.asStateFlow()
|
||||
@@ -182,7 +183,8 @@ class ManageStorageSettingsViewModel : ViewModel() {
|
||||
val onDeviceStorageOptimizationState: OnDeviceStorageOptimizationState = OnDeviceStorageOptimizationState.FEATURE_NOT_AVAILABLE,
|
||||
val storageOptimizationStateChanged: Boolean = false,
|
||||
val isPaidTierPending: Boolean = false,
|
||||
val localBackupsEnabled: Boolean = false
|
||||
val localBackupsEnabled: Boolean = false,
|
||||
val isPrimary: Boolean = true
|
||||
) {
|
||||
companion object {
|
||||
const val NO_LIMIT = 0
|
||||
|
||||
@@ -197,7 +197,7 @@ public final class SettingsValues extends SignalStoreValues {
|
||||
setSyncThreadTrimDeletes(!isTrimByLengthEnabled() && getKeepMessagesDuration() == KeepMessagesDuration.FOREVER);
|
||||
}
|
||||
|
||||
return getBoolean(THREAD_TRIM_SYNC_TO_LINKED_DEVICES, true);
|
||||
return getBoolean(THREAD_TRIM_SYNC_TO_LINKED_DEVICES, true) && SignalStore.account().isPrimaryDevice();
|
||||
}
|
||||
|
||||
public void setSyncThreadTrimDeletes(boolean syncDeletes) {
|
||||
|
||||
Reference in New Issue
Block a user