From b4f2d8682f169eef26007c1c79d7ac245779f2f3 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Wed, 27 May 2026 12:54:11 -0300 Subject: [PATCH] Always load avatar in the background. --- .../service/webrtc/ActiveCallManager.kt | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/ActiveCallManager.kt b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/ActiveCallManager.kt index 03bc84989a..2fac15deb8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/ActiveCallManager.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/ActiveCallManager.kt @@ -411,25 +411,23 @@ class ActiveCallManager( val recipient: Recipient = Recipient.resolved(IntentCompat.getParcelableExtra(intent, EXTRA_RECIPIENT_ID, RecipientId::class.java)!!) val isVideoCall = intent.getBooleanExtra(EXTRA_IS_VIDEO_CALL, false) - if (requiresAsyncNotificationLoad) { - if (asyncServiceNotification != null && lastAsyncServiceNotificationType == type) { - return asyncServiceNotification!! - } - - val requestTime = System.currentTimeMillis() - lastAsyncServiceNotificationRequestTime = requestTime - notificationDisposable = Single.fromCallable { createNotification(type, recipient, isVideoCall, skipAvatarLoad = false) } - .subscribeOn(Schedulers.io()) - .filter { requestTime == lastAsyncServiceNotificationRequestTime } - .observeOn(AndroidSchedulers.mainThread()) - .subscribeBy { notification -> - lastAsyncServiceNotificationType = type - asyncServiceNotification = notification - update(this, type, recipient.id, isVideoCall) - } + if (asyncServiceNotification != null && lastAsyncServiceNotificationType == type) { + return asyncServiceNotification!! } - return createNotification(type, recipient, isVideoCall, skipAvatarLoad = requiresAsyncNotificationLoad) + val requestTime = System.currentTimeMillis() + lastAsyncServiceNotificationRequestTime = requestTime + notificationDisposable = Single.fromCallable { createNotification(type, recipient, isVideoCall, skipAvatarLoad = false) } + .subscribeOn(Schedulers.io()) + .filter { requestTime == lastAsyncServiceNotificationRequestTime } + .observeOn(AndroidSchedulers.mainThread()) + .subscribeBy { notification -> + lastAsyncServiceNotificationType = type + asyncServiceNotification = notification + update(this, type, recipient.id, isVideoCall) + } + + return createNotification(type, recipient, isVideoCall, skipAvatarLoad = true) } override fun onServiceUpdateCommandReceived(intent: Intent) {