ios: remove no longer needed code
Ever since we switched to handling track events instead of mute actions this has been dead code. It was also added in the wrong place, since it's responsibility of the JS code to solve the ping-pong problem.
This commit is contained in:
parent
c1f8a35156
commit
603d161788
|
@ -21,7 +21,6 @@ import Foundation
|
|||
internal final class JMCallKitEmitter: NSObject, CXProviderDelegate {
|
||||
|
||||
private var listeners = Set<JMCallKitEventListenerWrapper>()
|
||||
private var pendingMuteActions = Set<UUID>()
|
||||
|
||||
internal override init() {}
|
||||
|
||||
|
@ -57,17 +56,10 @@ internal final class JMCallKitEmitter: NSObject, CXProviderDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: - Add mute action
|
||||
|
||||
func addMuteAction(_ actionUUID: UUID) {
|
||||
pendingMuteActions.insert(actionUUID)
|
||||
}
|
||||
|
||||
// MARK: - CXProviderDelegate
|
||||
|
||||
func providerDidReset(_ provider: CXProvider) {
|
||||
listeners.forEach { $0.listener?.providerDidReset?() }
|
||||
pendingMuteActions.removeAll()
|
||||
}
|
||||
|
||||
func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
|
||||
|
@ -87,17 +79,8 @@ internal final class JMCallKitEmitter: NSObject, CXProviderDelegate {
|
|||
}
|
||||
|
||||
func provider(_ provider: CXProvider, perform action: CXSetMutedCallAction) {
|
||||
let uuid = pendingMuteActions.remove(action.uuid)
|
||||
|
||||
// XXX avoid mute actions ping-pong: if the mute action was caused by
|
||||
// the JS side (we requested a transaction) don't call the delegate
|
||||
// method. If it was called by the provder itself (when the user presses
|
||||
// the mute button in the CallKit view) then call the delegate method.
|
||||
if (uuid == nil) {
|
||||
listeners.forEach {
|
||||
$0.listener?.performSetMutedCall?(UUID: action.callUUID,
|
||||
isMuted: action.isMuted)
|
||||
}
|
||||
listeners.forEach {
|
||||
$0.listener?.performSetMutedCall?(UUID: action.callUUID, isMuted: action.isMuted)
|
||||
}
|
||||
|
||||
action.fulfill()
|
||||
|
|
|
@ -156,14 +156,6 @@ import Foundation
|
|||
completion: @escaping (Error?) -> Swift.Void) {
|
||||
guard enabled else { return }
|
||||
|
||||
// XXX keep track of muted actions to avoid "ping-pong"ing. See
|
||||
// JMCallKitEmitter for details on the CXSetMutedCallAction handling.
|
||||
for action in transaction.actions {
|
||||
if (action as? CXSetMutedCallAction) != nil {
|
||||
emitter.addMuteAction(action.uuid)
|
||||
}
|
||||
}
|
||||
|
||||
callController.request(transaction, completion: completion)
|
||||
}
|
||||
|
||||
|
@ -191,4 +183,3 @@ import Foundation
|
|||
return update
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue