mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
If both usernames hashes are empty, consider valid.
This commit is contained in:
@@ -264,7 +264,9 @@ public class RefreshOwnProfileJob extends BaseJob {
|
||||
String remoteUsernameHash = whoAmIResponse.getUsernameHash();
|
||||
String localUsernameHash = localUsername != null ? Base64.encodeUrlSafeWithoutPadding(new Username(localUsername).getHash()) : null;
|
||||
|
||||
if (!Objects.equals(localUsernameHash, remoteUsernameHash)) {
|
||||
if (TextUtils.isEmpty(localUsernameHash) && TextUtils.isEmpty(remoteUsernameHash)) {
|
||||
Log.d(TAG, "Local and remote username hash are both empty. Considering validated.");
|
||||
} else if (!Objects.equals(localUsernameHash, remoteUsernameHash)) {
|
||||
Log.w(TAG, "Local username hash does not match server username hash. Local hash: " + (TextUtils.isEmpty(localUsername) ? "empty" : "present") + ", Remote hash: " + (TextUtils.isEmpty(localUsername) ? "empty" : "present"));
|
||||
SignalStore.account().setUsernameSyncState(AccountValues.UsernameSyncState.USERNAME_AND_LINK_CORRUPTED);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user