Hardcode paymentActivation flag to true

This commit is contained in:
Katherine
2024-04-01 15:07:11 -07:00
committed by GitHub
parent a9d0ab271d
commit d002e5dda8
6 changed files with 16 additions and 16 deletions

View File

@@ -439,7 +439,7 @@ public class ProfileController {
return new BaseProfileResponse(account.getIdentityKey(IdentityType.ACI),
account.getUnidentifiedAccessKey().map(UnidentifiedAccessChecksum::generateFor).orElse(null),
account.isUnrestrictedUnidentifiedAccess(),
UserCapabilities.createForAccount(account),
new UserCapabilities(),
profileBadgeConverter.convert(
getAcceptableLanguagesForRequest(containerRequestContext),
account.getBadges(),
@@ -451,7 +451,7 @@ public class ProfileController {
return new BaseProfileResponse(account.getIdentityKey(IdentityType.PNI),
null,
false,
UserCapabilities.createForAccount(account),
new UserCapabilities(),
Collections.emptyList(),
new PniServiceIdentifier(account.getPhoneNumberIdentifier()));
}

View File

@@ -5,16 +5,16 @@
package org.whispersystems.textsecuregcm.entities;
import org.whispersystems.textsecuregcm.storage.Account;
public record UserCapabilities(
// TODO: Remove the paymentActivation capability entirely sometime soon after 2024-06-30
boolean paymentActivation,
// TODO Remove the PNI and PNP capabilities entirely on or after 2024-05-18
boolean pni,
boolean pnp,
// TODO Remove the giftBadges capability on or after 2024-05-26
boolean giftBadges) {
public record UserCapabilities(boolean paymentActivation,
// TODO Remove the PNI and PNP capabilities entirely on or after 2024-05-18
boolean pni,
boolean pnp,
// TODO Remove the giftBadges capability on or after 2024-05-26
boolean giftBadges) {
public static UserCapabilities createForAccount(final Account account) {
return new UserCapabilities(account.isPaymentActivationSupported(), true, true, true);
public UserCapabilities() {
this(true, true, true, true);
}
}

View File

@@ -105,7 +105,7 @@ public class ProfileGrpcHelper {
final ProfileBadgeConverter profileBadgeConverter) {
final GetUnversionedProfileResponse.Builder responseBuilder = GetUnversionedProfileResponse.newBuilder()
.setIdentityKey(ByteString.copyFrom(targetAccount.getIdentityKey(targetIdentifier.identityType()).serialize()))
.setCapabilities(buildUserCapabilities(org.whispersystems.textsecuregcm.entities.UserCapabilities.createForAccount(targetAccount)));
.setCapabilities(buildUserCapabilities(new org.whispersystems.textsecuregcm.entities.UserCapabilities()));
switch (targetIdentifier.identityType()) {
case ACI -> {