From 4cbf1bc33721720fbd482586bbc6499f0185cadd Mon Sep 17 00:00:00 2001
From: 0x330a <92654767+0x330a@users.noreply.github.com>
Date: Tue, 23 May 2023 12:07:09 +1000
Subject: [PATCH] feat: add logs and fix compile issue with a themes.xml entry,
add removing profile picture into logic for profile manager
---
.../thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java | 2 +-
.../org/thoughtcrime/securesms/sskenvironment/ProfileManager.kt | 2 ++
app/src/main/res/values/themes.xml | 2 --
3 files changed, 3 insertions(+), 3 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 b4f61a694b..3e80b7c10b 100644
--- a/app/src/main/java/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java
+++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java
@@ -111,7 +111,7 @@ public class RetrieveProfileAvatarJob extends BaseJob {
}
database.setProfileAvatar(recipient, profileAvatar);
} catch (Exception e) {
-
+ Log.e("Loki", "Failed to download profile avatar", e);
} finally {
if (downloadDestination != null) downloadDestination.delete();
}
diff --git a/app/src/main/java/org/thoughtcrime/securesms/sskenvironment/ProfileManager.kt b/app/src/main/java/org/thoughtcrime/securesms/sskenvironment/ProfileManager.kt
index 878ac9a433..fbbdebf6c0 100644
--- a/app/src/main/java/org/thoughtcrime/securesms/sskenvironment/ProfileManager.kt
+++ b/app/src/main/java/org/thoughtcrime/securesms/sskenvironment/ProfileManager.kt
@@ -96,6 +96,8 @@ class ProfileManager(private val context: Context, private val configFactory: Co
val key = contact.profilePictureEncryptionKey
if (!url.isNullOrEmpty() && key != null && key.size == 32) {
this.profilePicture = UserPic(url, key)
+ } else if (url.isNullOrEmpty() && key == null) {
+ this.profilePicture = UserPic.DEFAULT
}
}
if (contactConfig.needsPush()) {
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 68588b2cae..44cef145ce 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -661,7 +661,6 @@
- @color/classic_dark_1
- @color/classic_dark_1
- @color/classic_dark_3
- - @color/classic_dark_3
- @style/Dark.Popup
- @null
- @style/ThemeOverlay.AppCompat.Dark.ActionBar
@@ -709,7 +708,6 @@
- @color/classic_dark_2
- @color/classic_dark_3
- @color/classic_dark_2
- - @color/classic_dark_3
- @color/classic_dark_1
- @color/classic_dark_3
- @color/classic_dark_4