Stop broadcasting the change number capability.

This commit is contained in:
Greyson Parrelli
2021-09-09 17:51:18 -04:00
parent f61d7a9f77
commit 1494a3559d
2 changed files with 8 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package org.thoughtcrime.securesms;
import org.thoughtcrime.securesms.util.FeatureFlags;
import org.whispersystems.signalservice.api.account.AccountAttributes;
public final class AppCapabilities {
@@ -12,13 +13,12 @@ public final class AppCapabilities {
private static final boolean GV1_MIGRATION = true;
private static final boolean ANNOUNCEMENT_GROUPS = true;
private static final boolean SENDER_KEY = true;
private static final boolean CHANGE_NUMBER = true;
/**
* @param storageCapable Whether or not the user can use storage service. This is another way of
* asking if the user has set a Signal PIN or not.
*/
public static AccountAttributes.Capabilities getCapabilities(boolean storageCapable) {
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable, GV1_MIGRATION, SENDER_KEY, ANNOUNCEMENT_GROUPS, CHANGE_NUMBER);
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable, GV1_MIGRATION, SENDER_KEY, ANNOUNCEMENT_GROUPS, FeatureFlags.changeNumber());
}
}

View File

@@ -87,9 +87,10 @@ public class ApplicationMigrations {
static final int SENDER_KEY_3 = 43;
static final int CHANGE_NUMBER_SYNC = 44;
static final int CHANGE_NUMBER_CAPABILITY = 45;
static final int CHANGE_NUMBER_CAPABILITY_2 = 46;
}
public static final int CURRENT_VERSION = 45;
public static final int CURRENT_VERSION = 46;
/**
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
@@ -379,6 +380,10 @@ public class ApplicationMigrations {
jobs.put(Version.CHANGE_NUMBER_CAPABILITY, new AttributesMigrationJob());
}
if (lastSeenVersion < Version.CHANGE_NUMBER_CAPABILITY_2) {
jobs.put(Version.CHANGE_NUMBER_CAPABILITY_2, new AttributesMigrationJob());
}
return jobs;
}