Always load avatar in the background.

This commit is contained in:
Alex Hart
2026-05-27 12:54:11 -03:00
committed by GitHub
parent a05ce88bc0
commit b4f2d8682f
@@ -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) {