From a60712c09daa1e08bb756c47af3bfd08851fd0b2 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 7 Nov 2023 14:44:07 -0500 Subject: [PATCH] If both usernames hashes are empty, consider valid. --- .../org/thoughtcrime/securesms/jobs/RefreshOwnProfileJob.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/RefreshOwnProfileJob.java b/app/src/main/java/org/thoughtcrime/securesms/jobs/RefreshOwnProfileJob.java index 3bcf12aa88..27ef200a25 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/RefreshOwnProfileJob.java +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/RefreshOwnProfileJob.java @@ -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;