Do not show profile name changes if names are visually identical.

Fixes #9860
This commit is contained in:
Greyson Parrelli
2020-07-24 14:20:52 -04:00
parent bccc58d693
commit 5cd4726e23
2 changed files with 32 additions and 8 deletions

View File

@@ -13,6 +13,8 @@ import org.thoughtcrime.securesms.util.StringUtil;
import org.thoughtcrime.securesms.util.cjkv.CJKVUtil;
import org.whispersystems.signalservice.api.crypto.ProfileCipher;
import java.util.Objects;
public final class ProfileName implements Parcelable {
public static final ProfileName EMPTY = new ProfileName("", "");
@@ -133,6 +135,20 @@ public final class ProfileName implements Parcelable {
dest.writeString(familyName);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ProfileName that = (ProfileName) o;
return Objects.equals(givenName, that.givenName) &&
Objects.equals(familyName, that.familyName);
}
@Override
public int hashCode() {
return Objects.hash(givenName, familyName);
}
public static final Creator<ProfileName> CREATOR = new Creator<ProfileName>() {
@Override
public ProfileName createFromParcel(Parcel in) {