Inline the delete sync feature flag.

This commit is contained in:
Greyson Parrelli 2024-07-03 16:40:05 -04:00 committed by Cody Henthorne
parent 84fbb7c466
commit 94795599e2
3 changed files with 8 additions and 15 deletions

View file

@ -1,6 +1,5 @@
package org.thoughtcrime.securesms
import org.thoughtcrime.securesms.util.RemoteConfig
import org.whispersystems.signalservice.api.account.AccountAttributes
object AppCapabilities {
@ -12,7 +11,7 @@ object AppCapabilities {
fun getCapabilities(storageCapable: Boolean): AccountAttributes.Capabilities {
return AccountAttributes.Capabilities(
storage = storageCapable,
deleteSync = RemoteConfig.deleteSyncEnabled
deleteSync = true
)
}
}

View file

@ -12,6 +12,7 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.jobmanager.JobManager;
import org.thoughtcrime.securesms.jobmanager.migrations.RetrieveProfileJobMigration;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.stickers.BlessedPacks;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
@ -148,9 +149,10 @@ public class ApplicationMigrations {
static final int ATTACHMENT_HASH_BACKFILL = 104;
static final int SUBSCRIBER_ID = 105;
static final int CONTACT_LINK_REBUILD = 106;
static final int DELETE_SYNC_CAPABILITY = 107;
}
public static final int CURRENT_VERSION = 106;
public static final int CURRENT_VERSION = 107;
/**
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
@ -677,6 +679,10 @@ public class ApplicationMigrations {
jobs.put(Version.CONTACT_LINK_REBUILD, new ContactLinkRebuildMigrationJob());
}
if (lastSeenVersion < Version.DELETE_SYNC_CAPABILITY) {
jobs.put(Version.DELETE_SYNC_CAPABILITY, new AttributesMigrationJob());
}
return jobs;
}

View file

@ -10,8 +10,6 @@ import org.signal.core.util.mebiBytes
import org.thoughtcrime.securesms.BuildConfig
import org.thoughtcrime.securesms.dependencies.AppDependencies
import org.thoughtcrime.securesms.groups.SelectionLimits
import org.thoughtcrime.securesms.jobs.RefreshAttributesJob
import org.thoughtcrime.securesms.jobs.RefreshOwnProfileJob
import org.thoughtcrime.securesms.jobs.RemoteConfigRefreshJob
import org.thoughtcrime.securesms.jobs.Svr3MirrorJob
import org.thoughtcrime.securesms.keyvalue.SignalStore
@ -1063,16 +1061,6 @@ object RemoteConfig {
hotSwappable = true
)
/** Whether or not to delete syncing is enabled. */
val deleteSyncEnabled: Boolean by remoteBoolean(
key = "android.deleteSyncEnabled",
defaultValue = false,
hotSwappable = true,
onChangeListener = {
AppDependencies.jobManager.startChain(RefreshAttributesJob()).then(RefreshOwnProfileJob()).enqueue()
}
)
/** Which phase we're in for the SVR3 migration */
val svr3MigrationPhase: Int by remoteInt(
key = "global.svr3.phase",