mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 09:20:29 +01:00
Add emojis/"about" text to profiles
This commit is contained in:
@@ -8,6 +8,7 @@ package org.whispersystems.textsecuregcm.entities;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.signal.zkgroup.profiles.ProfileKeyCommitment;
|
||||
import org.whispersystems.textsecuregcm.util.ExactlySize;
|
||||
@@ -27,6 +28,14 @@ public class CreateProfileRequest {
|
||||
@JsonProperty
|
||||
private boolean avatar;
|
||||
|
||||
@JsonProperty
|
||||
@ExactlySize({0, 80})
|
||||
private String aboutEmoji;
|
||||
|
||||
@JsonProperty
|
||||
@ExactlySize({0, 208, 376, 720})
|
||||
private String about;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@JsonDeserialize(using = ProfileKeyCommitmentAdapter.Deserializing.class)
|
||||
@@ -35,10 +44,12 @@ public class CreateProfileRequest {
|
||||
|
||||
public CreateProfileRequest() {}
|
||||
|
||||
public CreateProfileRequest(ProfileKeyCommitment commitment, String version, String name, boolean wantsAvatar) {
|
||||
public CreateProfileRequest(ProfileKeyCommitment commitment, String version, String name, String aboutEmoji, String about, boolean wantsAvatar) {
|
||||
this.commitment = commitment;
|
||||
this.version = version;
|
||||
this.name = name;
|
||||
this.aboutEmoji = aboutEmoji;
|
||||
this.about = about;
|
||||
this.avatar = wantsAvatar;
|
||||
}
|
||||
|
||||
@@ -57,4 +68,12 @@ public class CreateProfileRequest {
|
||||
public boolean isAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public String getAboutEmoji() {
|
||||
return StringUtils.stripToNull(aboutEmoji);
|
||||
}
|
||||
|
||||
public String getAbout() {
|
||||
return StringUtils.stripToNull(about);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,12 @@ public class Profile {
|
||||
@JsonProperty
|
||||
private String name;
|
||||
|
||||
@JsonProperty
|
||||
private String about;
|
||||
|
||||
@JsonProperty
|
||||
private String aboutEmoji;
|
||||
|
||||
@JsonProperty
|
||||
private String avatar;
|
||||
|
||||
@@ -52,13 +58,15 @@ public class Profile {
|
||||
|
||||
public Profile() {}
|
||||
|
||||
public Profile(String name, String avatar, String identityKey,
|
||||
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)
|
||||
{
|
||||
this.name = name;
|
||||
this.about = about;
|
||||
this.aboutEmoji = aboutEmoji;
|
||||
this.avatar = avatar;
|
||||
this.identityKey = identityKey;
|
||||
this.unidentifiedAccess = unidentifiedAccess;
|
||||
@@ -80,6 +88,14 @@ public class Profile {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getAbout() {
|
||||
return about;
|
||||
}
|
||||
|
||||
public String getAboutEmoji() {
|
||||
return aboutEmoji;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
|
||||
Reference in New Issue
Block a user