Add payment address to the versioned profile

This commit is contained in:
Ehren Kret
2021-02-12 17:33:26 -06:00
parent ae329e735f
commit 142376f360
10 changed files with 229 additions and 112 deletions

View File

@@ -35,6 +35,10 @@ public class CreateProfileRequest {
@ExactlySize({0, 208, 376, 720})
private String about;
@JsonProperty
@ExactlySize({0, 684})
private String paymentAddress;
@JsonProperty
@NotNull
@JsonDeserialize(using = ProfileKeyCommitmentAdapter.Deserializing.class)
@@ -43,13 +47,16 @@ public class CreateProfileRequest {
public CreateProfileRequest() {}
public CreateProfileRequest(ProfileKeyCommitment commitment, String version, String name, String aboutEmoji, String about, boolean wantsAvatar) {
public CreateProfileRequest(
ProfileKeyCommitment commitment, String version, String name, String aboutEmoji, String about,
String paymentAddress, boolean wantsAvatar) {
this.commitment = commitment;
this.version = version;
this.name = name;
this.version = version;
this.name = name;
this.aboutEmoji = aboutEmoji;
this.about = about;
this.avatar = wantsAvatar;
this.about = about;
this.paymentAddress = paymentAddress;
this.avatar = wantsAvatar;
}
public ProfileKeyCommitment getCommitment() {
@@ -75,4 +82,8 @@ public class CreateProfileRequest {
public String getAbout() {
return StringUtils.stripToNull(about);
}
public String getPaymentAddress() {
return paymentAddress;
}
}

View File

@@ -9,12 +9,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.annotations.VisibleForTesting;
import org.signal.zkgroup.profiles.ProfileKeyCredentialResponse;
import org.whispersystems.textsecuregcm.storage.PaymentAddress;
import java.util.List;
import java.util.UUID;
import org.signal.zkgroup.profiles.ProfileKeyCredentialResponse;
import org.whispersystems.textsecuregcm.storage.PaymentAddress;
public class Profile {
@@ -33,6 +31,9 @@ public class Profile {
@JsonProperty
private String avatar;
@JsonProperty
private String paymentAddress;
@JsonProperty
private String unidentifiedAccess;
@@ -58,24 +59,24 @@ public class Profile {
public Profile() {}
public Profile(String name, String about, String aboutEmoji, String avatar, String identityKey,
String unidentifiedAccess, boolean unrestrictedUnidentifiedAccess,
UserCapabilities capabilities, String username, UUID uuid,
ProfileKeyCredentialResponse credential,
List<PaymentAddress> payments)
public Profile(
String name, String about, String aboutEmoji, String avatar, String paymentAddress, String identityKey,
String unidentifiedAccess, boolean unrestrictedUnidentifiedAccess, UserCapabilities capabilities, String username,
UUID uuid, ProfileKeyCredentialResponse credential, List<PaymentAddress> payments)
{
this.name = name;
this.about = about;
this.aboutEmoji = aboutEmoji;
this.avatar = avatar;
this.identityKey = identityKey;
this.unidentifiedAccess = unidentifiedAccess;
this.name = name;
this.about = about;
this.aboutEmoji = aboutEmoji;
this.avatar = avatar;
this.paymentAddress = paymentAddress;
this.identityKey = identityKey;
this.unidentifiedAccess = unidentifiedAccess;
this.unrestrictedUnidentifiedAccess = unrestrictedUnidentifiedAccess;
this.capabilities = capabilities;
this.username = username;
this.uuid = uuid;
this.payments = payments;
this.credential = credential;
this.capabilities = capabilities;
this.username = username;
this.uuid = uuid;
this.payments = payments;
this.credential = credential;
}
@VisibleForTesting
@@ -101,6 +102,10 @@ public class Profile {
return avatar;
}
public String getPaymentAddress() {
return paymentAddress;
}
@VisibleForTesting
public String getUnidentifiedAccess() {
return unidentifiedAccess;