Skip to content

Commit

Permalink
Update ZMUserSession+WireCallStateObserver.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
agisilaos committed Oct 17, 2024
1 parent 37232de commit 702ce5b
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,21 @@ import WireAnalytics
import WireDataModel

extension ZMUserSession: WireCallCenterCallStateObserver {

public func callCenterDidChange(
callState: CallState,
conversation: ZMConversation,
caller: any UserType,
timestamp: Date?,
previousCallState: CallState?
) {
guard let conversationId = conversation.remoteIdentifier else { return }

let isVideoCall = isVideoCall(for: conversation)

switch callState {
case .outgoing:
switch (callState, previousCallState) {
case (.outgoing, _):
let isVideoCall = isVideoCall(for: conversation)
trackCallInitialized(isVideo: isVideoCall, conversationType: conversation.conversationType)
case .answered:
case (.answered(_), .incoming(video: let isVideoCall, shouldRing: _, degraded: _)):
trackCallJoined(isVideo: isVideoCall, conversationType: conversation.conversationType)

default:
break
}
Expand Down

0 comments on commit 702ce5b

Please sign in to comment.