Skip to content

Commit

Permalink
Make verificationV2 a separate flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Aug 7, 2020
1 parent 1634d7d commit 57150a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public void onCreate(Bundle bundle) {
byte[] localId;
byte[] remoteId;

if (FeatureFlags.cds() && recipient.resolve().getUuid().isPresent()) {
if (FeatureFlags.verifyV2() && recipient.resolve().getUuid().isPresent()) {
Log.i(TAG, "Using UUID (version 2).");
version = 2;
localId = UuidUtil.toByteArray(TextSecurePreferences.getLocalUuid(requireContext()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ public final class FeatureFlags {
private static final String GROUPS_V2 = "android.groupsv2.3";
private static final String GROUPS_V2_CREATE = "android.groupsv2.create.3";
private static final String GROUPS_V2_CAPACITY = "all.groupsv2.capacity";
private static final String CDS = "android.cds.2";
private static final String CDS = "android.cds.3";
private static final String INTERNAL_USER = "android.internalUser";
private static final String MENTIONS = "android.mentions";
private static final String VERIFY_V2 = "android.verifyV2";

/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
Expand All @@ -72,7 +73,8 @@ public final class FeatureFlags {
GROUPS_V2_CREATE,
GROUPS_V2_CAPACITY,
INTERNAL_USER,
MENTIONS
MENTIONS,
VERIFY_V2
);

/**
Expand All @@ -94,7 +96,8 @@ public final class FeatureFlags {
*/
private static final Set<String> HOT_SWAPPABLE = Sets.newHashSet(
ATTACHMENTS_V3,
GROUPS_V2_CREATE
GROUPS_V2_CREATE,
VERIFY_V2
);

/**
Expand All @@ -103,7 +106,8 @@ public final class FeatureFlags {
private static final Set<String> STICKY = Sets.newHashSet(
GROUPS_V2,
GROUPS_V2_OLD_1,
GROUPS_V2_OLD_2
GROUPS_V2_OLD_2,
VERIFY_V2
);

/**
Expand Down Expand Up @@ -231,6 +235,11 @@ public static boolean mentions() {
return getBoolean(MENTIONS, false);
}

/** Whether or not to use the UUID in verification codes. */
public static boolean verifyV2() {
return getBoolean(VERIFY_V2, false);
}

/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);
Expand Down

0 comments on commit 57150a2

Please sign in to comment.