From e059fdaa19a9655dad5b38d7e9502714d1a8c50d Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Thu, 6 Apr 2023 10:53:21 +1000 Subject: [PATCH] Revert "fix: profile avatar fixes for local user now that we aren't setting local user profile key" This reverts commit 3f569e34034713ee230581bc118e9127a8d0f434. --- .../securesms/jobs/RetrieveProfileAvatarJob.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java b/app/src/main/java/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java index d6e60628be..7331f879cb 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java @@ -14,7 +14,6 @@ import org.session.libsession.utilities.Util; import org.session.libsession.utilities.recipients.Recipient; import org.session.libsignal.exceptions.PushNetworkException; import org.session.libsignal.streams.ProfileCipherInputStream; -import org.session.libsignal.utilities.Base64; import org.session.libsignal.utilities.Log; import org.thoughtcrime.securesms.database.RecipientDatabase; import org.thoughtcrime.securesms.dependencies.DatabaseComponent; @@ -79,19 +78,7 @@ public class RetrieveProfileAvatarJob extends BaseJob { @Override public void onRun() throws IOException { RecipientDatabase database = DatabaseComponent.get(context).recipientDatabase(); - byte[] profileKey = null; - if (recipient.resolve().isLocalNumber()) { - try { - String encodedProfileKey = TextSecurePreferences.getProfileKey(context); - if (encodedProfileKey != null) { - profileKey = Base64.decode(encodedProfileKey); - } - } catch (Exception e) { - Log.e(TAG, "Failed to decode local user profile key", e); - } - } else { - profileKey = recipient.resolve().getProfileKey(); - } + byte[] profileKey = recipient.resolve().getProfileKey(); if (profileKey == null || (profileKey.length != 32 && profileKey.length != 16)) { Log.w(TAG, "Recipient profile key is gone!");