Remove GV2 create flag.
This commit is contained in:
parent
385bd0eb8a
commit
d04e4606d2
5 changed files with 11 additions and 20 deletions
|
@ -13,11 +13,11 @@ import org.signal.zkgroup.groups.UuidCiphertext;
|
|||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase;
|
||||
import org.thoughtcrime.securesms.groups.v2.GroupLinkPassword;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.signalservice.api.groupsv2.GroupLinkNotActiveException;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public final class GroupManager {
|
|||
boolean mms)
|
||||
throws GroupChangeBusyException, GroupChangeFailedException, IOException
|
||||
{
|
||||
boolean shouldAttemptToCreateV2 = !mms && FeatureFlags.groupsV2create();
|
||||
boolean shouldAttemptToCreateV2 = !mms && !SignalStore.internalValues().gv2DoNotCreateGv2Groups();
|
||||
Set<RecipientId> memberIds = getMemberIds(members);
|
||||
|
||||
if (shouldAttemptToCreateV2) {
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.thoughtcrime.securesms.contacts.sync.DirectoryHelper;
|
|||
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
||||
import org.thoughtcrime.securesms.groups.GroupsV2CapabilityChecker;
|
||||
import org.thoughtcrime.securesms.groups.ui.creategroup.details.AddGroupDetailsActivity;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
|
@ -55,8 +56,8 @@ public class CreateGroupActivity extends ContactSelectionActivity {
|
|||
: ContactsCursorLoader.DisplayMode.FLAG_PUSH;
|
||||
|
||||
intent.putExtra(ContactSelectionListFragment.DISPLAY_MODE, displayMode);
|
||||
intent.putExtra(ContactSelectionListFragment.SELECTION_LIMIT, FeatureFlags.groupsV2create() ? FeatureFlags.gv2GroupCapacity() - 1
|
||||
: ContactSelectionListFragment.NO_LIMIT);
|
||||
intent.putExtra(ContactSelectionListFragment.SELECTION_LIMIT, SignalStore.internalValues().gv2DoNotCreateGv2Groups() ? ContactSelectionListFragment.NO_LIMIT
|
||||
: FeatureFlags.gv2GroupCapacity() - 1);
|
||||
|
||||
return intent;
|
||||
}
|
||||
|
@ -156,7 +157,7 @@ public class CreateGroupActivity extends ContactSelectionActivity {
|
|||
List<Recipient> recipientsAndSelf = new ArrayList<>(resolved);
|
||||
recipientsAndSelf.add(Recipient.self().resolve());
|
||||
|
||||
if (FeatureFlags.groupsV2create()) {
|
||||
if (!SignalStore.internalValues().gv2DoNotCreateGv2Groups()) {
|
||||
try {
|
||||
GroupsV2CapabilityChecker.refreshCapabilitiesIfNecessary(recipientsAndSelf);
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -14,10 +14,10 @@ import com.annimon.stream.Collectors;
|
|||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.thoughtcrime.securesms.groups.ui.GroupMemberEntry;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.DefaultValueLiveData;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.SingleLiveEvent;
|
||||
import org.thoughtcrime.securesms.util.livedata.LiveDataUtil;
|
||||
|
||||
|
@ -54,10 +54,10 @@ public final class AddGroupDetailsViewModel extends ViewModel {
|
|||
isMms = Transformations.map(members, AddGroupDetailsViewModel::isAnyForcedSms);
|
||||
|
||||
LiveData<List<GroupMemberEntry.NewGroupCandidate>> membersToCheckGv2CapabilityOf = LiveDataUtil.combineLatest(isMms, members, (forcedMms, memberList) -> {
|
||||
if (FeatureFlags.groupsV2create() && !forcedMms) {
|
||||
return memberList;
|
||||
} else {
|
||||
if (SignalStore.internalValues().gv2DoNotCreateGv2Groups() || forcedMms) {
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
return memberList;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
|||
import org.thoughtcrime.securesms.util.AsynchronousCallback;
|
||||
import org.thoughtcrime.securesms.util.DefaultValueLiveData;
|
||||
import org.thoughtcrime.securesms.util.ExpirationUtil;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.livedata.LiveDataUtil;
|
||||
import org.thoughtcrime.securesms.util.views.SimpleProgressDialog;
|
||||
|
@ -101,7 +100,7 @@ public class ManageGroupViewModel extends ViewModel {
|
|||
ManageGroupViewModel::filterMemberList);
|
||||
this.pendingMemberCount = liveGroup.getPendingMemberCount();
|
||||
this.pendingAndRequestingCount = liveGroup.getPendingAndRequestingMemberCount();
|
||||
this.showLegacyIndicator = new MutableLiveData<>(groupId.isV1() && FeatureFlags.groupsV2create());
|
||||
this.showLegacyIndicator = new MutableLiveData<>(groupId.isV1());
|
||||
this.memberCountSummary = LiveDataUtil.combineLatest(liveGroup.getMembershipCountDescription(context.getResources()),
|
||||
this.showLegacyIndicator,
|
||||
(description, legacy) -> legacy ? String.format("%s · %s", description, context.getString(R.string.ManageGroupActivity_legacy_group))
|
||||
|
|
|
@ -48,7 +48,6 @@ public final class FeatureFlags {
|
|||
private static final long FETCH_INTERVAL = TimeUnit.HOURS.toMillis(2);
|
||||
|
||||
private static final String USERNAMES = "android.usernames";
|
||||
private static final String GROUPS_V2_CREATE_VERSION = "android.groupsv2.createVersion";
|
||||
private static final String GROUPS_V2_JOIN_VERSION = "android.groupsv2.joinVersion";
|
||||
private static final String GROUPS_V2_LINKS_VERSION = "android.groupsv2.manageGroupLinksVersion";
|
||||
private static final String GROUPS_V2_CAPACITY = "global.groupsv2.maxGroupSize";
|
||||
|
@ -66,7 +65,6 @@ public final class FeatureFlags {
|
|||
*/
|
||||
|
||||
private static final Set<String> REMOTE_CAPABLE = Sets.newHashSet(
|
||||
GROUPS_V2_CREATE_VERSION,
|
||||
GROUPS_V2_CAPACITY,
|
||||
GROUPS_V2_JOIN_VERSION,
|
||||
GROUPS_V2_LINKS_VERSION,
|
||||
|
@ -97,7 +95,6 @@ public final class FeatureFlags {
|
|||
* more burden on the reader to ensure that the app experience remains consistent.
|
||||
*/
|
||||
private static final Set<String> HOT_SWAPPABLE = Sets.newHashSet(
|
||||
GROUPS_V2_CREATE_VERSION,
|
||||
GROUPS_V2_JOIN_VERSION,
|
||||
VERIFY_V2,
|
||||
CLIENT_EXPIRATION
|
||||
|
@ -174,12 +171,6 @@ public final class FeatureFlags {
|
|||
return getBoolean(USERNAMES, false);
|
||||
}
|
||||
|
||||
/** Attempt groups v2 creation. */
|
||||
public static boolean groupsV2create() {
|
||||
return getVersionFlag(GROUPS_V2_CREATE_VERSION) == VersionFlag.ON &&
|
||||
!SignalStore.internalValues().gv2DoNotCreateGv2Groups();
|
||||
}
|
||||
|
||||
/** Allow creation and managing of group links. */
|
||||
public static boolean groupsV2manageGroupLinks() {
|
||||
return getVersionFlag(GROUPS_V2_LINKS_VERSION) == VersionFlag.ON;
|
||||
|
|
Loading…
Add table
Reference in a new issue