Delay seting up a "new" call session until after accepting the incoming call.

This commit is contained in:
Stefan Ceriu 2024-05-27 12:56:46 +03:00 committed by Stefan Ceriu
parent e76fabf18c
commit 4c1311c11b

View File

@ -141,7 +141,10 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
if let incomingCallRoomID {
actionsSubject.send(.answerCall(roomID: incomingCallRoomID))
Task {
// Dispatch to next run loop so it doesn't conflict with `setupCallSession`
actionsSubject.send(.answerCall(roomID: incomingCallRoomID))
}
self.incomingCallRoomID = nil
} else {
MXLog.error("Failed answering incoming call, missing room ID")