From a6c3b5d4afd8ccef2e41062dfb78077a08689855 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 4 Jun 2025 11:51:09 +0300 Subject: [PATCH] Allow multiple room info updates when receiving a call before deciding the room doesn't have an active call anymore. --- NSE/Sources/NotificationHandler.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/NSE/Sources/NotificationHandler.swift b/NSE/Sources/NotificationHandler.swift index e0c35d655..69aa4686b 100644 --- a/NSE/Sources/NotificationHandler.swift +++ b/NSE/Sources/NotificationHandler.swift @@ -176,9 +176,13 @@ class NotificationHandler { if !room.hasActiveRoomCall() { // If I don't have an active call wait a bit and make sure let expiringTask = ExpiringTaskRunner { await withCheckedContinuation { [weak self] continuation in - self?.roomInfoObservationToken = room.subscribeToRoomInfoUpdates(listener: SDKListener { _ in - MXLog.info("Received room info update") - continuation.resume() + self?.roomInfoObservationToken = room.subscribeToRoomInfoUpdates(listener: SDKListener { info in + if info.hasRoomCall { + MXLog.info("Received room info update and the room has an active call now.") + continuation.resume() + } else { + MXLog.info("Received a room info update but the room still doesn't have an ongoing call.") + } }) } }