From 53b759137f2af1f8f5e28399d9609e4f0490498d Mon Sep 17 00:00:00 2001 From: Aleksandar Apostolov Date: Mon, 1 Apr 2024 21:26:48 +0200 Subject: [PATCH] Propagate call ended correctly to subscribers (#1054) --- .../video/android/core/StreamVideoImpl.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt index ba0d8b9cc6..29ba2a0694 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt @@ -499,14 +499,6 @@ internal class StreamVideoImpl internal constructor( callEvent?.getCallCID() } ?: "" - if (selectedCid.isNotEmpty()) { - calls[selectedCid]?.let { - it.state.handleEvent(event) - it.session?.handleEvent(event) - it.handleEvent(event) - } - } - // client level subscriptions subscriptions.forEach { sub -> if (!sub.isDisposed) { @@ -527,6 +519,14 @@ internal class StreamVideoImpl internal constructor( if (selectedCid.isNotEmpty()) { calls[selectedCid]?.fireEvent(event) } + + if (selectedCid.isNotEmpty()) { + calls[selectedCid]?.let { + it.state.handleEvent(event) + it.session?.handleEvent(event) + it.handleEvent(event) + } + } } internal suspend fun getCall(type: String, id: String): Result {