Add internal preferences under Advanced behind feature flag.

Initially for GV2 testing.
This commit is contained in:
Alan Evans
2020-07-06 18:52:29 -03:00
committed by Greyson Parrelli
parent 545ba80697
commit e6a0e5b858
11 changed files with 150 additions and 12 deletions

View File

@@ -5,7 +5,9 @@ import org.whispersystems.libsignal.util.guava.Optional;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
/**
@@ -39,6 +41,21 @@ public final class GroupCandidate {
return profileKeyCredential.isPresent();
}
public static Set<GroupCandidate> withoutProfileKeyCredentials(Set<GroupCandidate> groupCandidates) {
HashSet<GroupCandidate> result = new HashSet<>(groupCandidates.size());
for (GroupCandidate candidate: groupCandidates) {
result.add(candidate.withoutProfileKeyCredential());
}
return result;
}
public GroupCandidate withoutProfileKeyCredential() {
return hasProfileKeyCredential() ? new GroupCandidate(uuid, Optional.absent())
: this;
}
public GroupCandidate withProfileKeyCredential(ProfileKeyCredential profileKeyCredential) {
return new GroupCandidate(uuid, Optional.of(profileKeyCredential));
}