From 3206ce380edbbc9155c96ba0813bb76697917e66 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Wed, 18 Aug 2021 09:00:55 +1000 Subject: [PATCH] =?UTF-8?q?Rename=20WebRTCWrapper=20=E2=86=92=20WebRTCSess?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Session.xcodeproj/project.pbxproj | 24 +++++++++---------- Session/Calls/CallVC+Camera.swift | 2 +- Session/Calls/CallVC.swift | 22 ++++++++--------- ...ft => WebRTCSession+MessageHandling.swift} | 2 +- ...rapper+UI.swift => WebRTCSession+UI.swift} | 2 +- ...ebRTCWrapper.swift => WebRTCSession.swift} | 8 +++---- .../Control Messages/CallMessage.swift | 4 ++-- .../MessageReceiver+Handling.swift | 14 +++++------ 8 files changed, 39 insertions(+), 39 deletions(-) rename SessionMessagingKit/Calls/{WebRTCWrapper+MessageHandling.swift => WebRTCSession+MessageHandling.swift} (97%) rename SessionMessagingKit/Calls/{WebRTCWrapper+UI.swift => WebRTCSession+UI.swift} (94%) rename SessionMessagingKit/Calls/{WebRTCWrapper.swift => WebRTCSession.swift} (97%) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 6b2b1e984..f20ced31b 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -157,7 +157,7 @@ B6FE7EB71ADD62FA00A6D22F /* PushKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6FE7EB61ADD62FA00A6D22F /* PushKit.framework */; }; B8041A9525C8FA1D003C2166 /* MediaLoaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8041A9425C8FA1D003C2166 /* MediaLoaderView.swift */; }; B8041AA725C90927003C2166 /* TypingIndicatorCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8041AA625C90927003C2166 /* TypingIndicatorCell.swift */; }; - B806ECA126C4A7E4008BDA44 /* WebRTCWrapper+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = B806ECA026C4A7E4008BDA44 /* WebRTCWrapper+UI.swift */; }; + B806ECA126C4A7E4008BDA44 /* WebRTCSession+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = B806ECA026C4A7E4008BDA44 /* WebRTCSession+UI.swift */; }; B80A579F23DFF1F300876683 /* NewClosedGroupVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B80A579E23DFF1F300876683 /* NewClosedGroupVC.swift */; }; B817AD9A26436593009DF825 /* SimplifiedConversationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B817AD9926436593009DF825 /* SimplifiedConversationCell.swift */; }; B817AD9C26436F73009DF825 /* ThreadPickerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B817AD9B26436F73009DF825 /* ThreadPickerVC.swift */; }; @@ -249,7 +249,7 @@ B8B3204E258C15C80020074B /* ContactsMigration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B32044258C117C0020074B /* ContactsMigration.swift */; }; B8B320B7258C30D70020074B /* HTMLMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B320B6258C30D70020074B /* HTMLMetadata.swift */; }; B8B558F126C4BB0600693325 /* CameraManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B558F026C4BB0600693325 /* CameraManager.swift */; }; - B8B558FF26C4E05E00693325 /* WebRTCWrapper+MessageHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B558FE26C4E05E00693325 /* WebRTCWrapper+MessageHandling.swift */; }; + B8B558FF26C4E05E00693325 /* WebRTCSession+MessageHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B558FE26C4E05E00693325 /* WebRTCSession+MessageHandling.swift */; }; B8BB82A5238F627000BA5194 /* HomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8BB82A4238F627000BA5194 /* HomeVC.swift */; }; B8BC00C0257D90E30032E807 /* General.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8BC00BF257D90E30032E807 /* General.swift */; }; B8C2B2C82563685C00551B4D /* CircleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C2B2C72563685C00551B4D /* CircleView.swift */; }; @@ -271,7 +271,7 @@ B8D64FCB25BA78A90029CFC0 /* SignalUtilitiesKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C33FD9AB255A548A00E217F9 /* SignalUtilitiesKit.framework */; }; B8D84EA325DF745A005A043E /* LinkPreviewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8D84EA225DF745A005A043E /* LinkPreviewState.swift */; }; B8D84ECF25E3108A005A043E /* ExpandingAttachmentsButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8D84ECE25E3108A005A043E /* ExpandingAttachmentsButton.swift */; }; - B8DE1FB426C22F2F0079C9CE /* WebRTCWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8DE1FB326C22F2F0079C9CE /* WebRTCWrapper.swift */; }; + B8DE1FB426C22F2F0079C9CE /* WebRTCSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8DE1FB326C22F2F0079C9CE /* WebRTCSession.swift */; }; B8DE1FB626C22FCB0079C9CE /* CallMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8DE1FB526C22FCB0079C9CE /* CallMessage.swift */; }; B8EB20EE2640F28000773E52 /* VisibleMessage+OpenGroupInvitation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EB20ED2640F28000773E52 /* VisibleMessage+OpenGroupInvitation.swift */; }; B8EB20F02640F7F000773E52 /* OpenGroupInvitationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EB20EF2640F7F000773E52 /* OpenGroupInvitationView.swift */; }; @@ -1147,7 +1147,7 @@ B6FE7EB61ADD62FA00A6D22F /* PushKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PushKit.framework; path = System/Library/Frameworks/PushKit.framework; sourceTree = SDKROOT; }; B8041A9425C8FA1D003C2166 /* MediaLoaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaLoaderView.swift; sourceTree = ""; }; B8041AA625C90927003C2166 /* TypingIndicatorCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypingIndicatorCell.swift; sourceTree = ""; }; - B806ECA026C4A7E4008BDA44 /* WebRTCWrapper+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WebRTCWrapper+UI.swift"; sourceTree = ""; }; + B806ECA026C4A7E4008BDA44 /* WebRTCSession+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WebRTCSession+UI.swift"; sourceTree = ""; }; B80A579E23DFF1F300876683 /* NewClosedGroupVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewClosedGroupVC.swift; sourceTree = ""; }; B817AD9926436593009DF825 /* SimplifiedConversationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimplifiedConversationCell.swift; sourceTree = ""; }; B817AD9B26436F73009DF825 /* ThreadPickerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadPickerVC.swift; sourceTree = ""; }; @@ -1220,7 +1220,7 @@ B8B32044258C117C0020074B /* ContactsMigration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsMigration.swift; sourceTree = ""; }; B8B320B6258C30D70020074B /* HTMLMetadata.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTMLMetadata.swift; sourceTree = ""; }; B8B558F026C4BB0600693325 /* CameraManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraManager.swift; sourceTree = ""; }; - B8B558FE26C4E05E00693325 /* WebRTCWrapper+MessageHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WebRTCWrapper+MessageHandling.swift"; sourceTree = ""; }; + B8B558FE26C4E05E00693325 /* WebRTCSession+MessageHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WebRTCSession+MessageHandling.swift"; sourceTree = ""; }; B8B5BCEB2394D869003823C9 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; B8BAC75B2695645400EA1759 /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/Localizable.strings; sourceTree = ""; }; B8BAC75C2695648500EA1759 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; @@ -1258,7 +1258,7 @@ B8D8F1BC25661C6F0092EF10 /* Storage+OnionRequests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Storage+OnionRequests.swift"; sourceTree = ""; }; B8D8F1EF256621180092EF10 /* MessageSender+Convenience.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "MessageSender+Convenience.swift"; path = "../../SignalUtilitiesKit/Messaging/Sending & Receiving/MessageSender+Convenience.swift"; sourceTree = ""; }; B8DE1FAF26C228780079C9CE /* SignalRingRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SignalRingRTC.framework; path = Dependencies/SignalRingRTC.framework; sourceTree = ""; }; - B8DE1FB326C22F2F0079C9CE /* WebRTCWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebRTCWrapper.swift; sourceTree = ""; }; + B8DE1FB326C22F2F0079C9CE /* WebRTCSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebRTCSession.swift; sourceTree = ""; }; B8DE1FB526C22FCB0079C9CE /* CallMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallMessage.swift; sourceTree = ""; }; B8EB20E6263F7E4B00773E52 /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/Localizable.strings; sourceTree = ""; }; B8EB20ED2640F28000773E52 /* VisibleMessage+OpenGroupInvitation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VisibleMessage+OpenGroupInvitation.swift"; sourceTree = ""; }; @@ -2357,9 +2357,9 @@ B8DE1FB226C22F1F0079C9CE /* Calls */ = { isa = PBXGroup; children = ( - B8DE1FB326C22F2F0079C9CE /* WebRTCWrapper.swift */, - B806ECA026C4A7E4008BDA44 /* WebRTCWrapper+UI.swift */, - B8B558FE26C4E05E00693325 /* WebRTCWrapper+MessageHandling.swift */, + B8DE1FB326C22F2F0079C9CE /* WebRTCSession.swift */, + B806ECA026C4A7E4008BDA44 /* WebRTCSession+UI.swift */, + B8B558FE26C4E05E00693325 /* WebRTCSession+MessageHandling.swift */, ); path = Calls; sourceTree = ""; @@ -4673,7 +4673,7 @@ C352A32F2557549C00338F3E /* NotifyPNServerJob.swift in Sources */, 7B4C75CB26B37E0F0000AC89 /* UnsendRequest.swift in Sources */, C300A5F22554B09800555489 /* MessageSender.swift in Sources */, - B8B558FF26C4E05E00693325 /* WebRTCWrapper+MessageHandling.swift in Sources */, + B8B558FF26C4E05E00693325 /* WebRTCSession+MessageHandling.swift in Sources */, C3C2A74D2553A39700C340D1 /* VisibleMessage.swift in Sources */, C32C5AAD256DBE8F003C73A2 /* TSInfoMessage.m in Sources */, C32C5A13256DB7A5003C73A2 /* PushNotificationAPI.swift in Sources */, @@ -4711,7 +4711,7 @@ B8856ECE256F1E58001CE70E /* OWSPreferences.m in Sources */, C3C2A7842553AAF300C340D1 /* SNProto.swift in Sources */, C32C5DC0256DD743003C73A2 /* Poller.swift in Sources */, - B8DE1FB426C22F2F0079C9CE /* WebRTCWrapper.swift in Sources */, + B8DE1FB426C22F2F0079C9CE /* WebRTCSession.swift in Sources */, C3C2A7682553A3D900C340D1 /* VisibleMessage+Contact.swift in Sources */, C3A3A171256E1D25004D228D /* SSKReachabilityManager.swift in Sources */, B8DE1FB626C22FCB0079C9CE /* CallMessage.swift in Sources */, @@ -4791,7 +4791,7 @@ C32C5D23256DD4C0003C73A2 /* Mention.swift in Sources */, C32C5FD6256E0346003C73A2 /* Notification+Thread.swift in Sources */, C3BBE0C72554F1570050F1E3 /* FixedWidthInteger+BigEndian.swift in Sources */, - B806ECA126C4A7E4008BDA44 /* WebRTCWrapper+UI.swift in Sources */, + B806ECA126C4A7E4008BDA44 /* WebRTCSession+UI.swift in Sources */, C32C5C88256DD0D2003C73A2 /* Storage+Messaging.swift in Sources */, C32C59C7256DB41F003C73A2 /* TSThread.m in Sources */, C300A5B22554AF9800555489 /* VisibleMessage+Profile.swift in Sources */, diff --git a/Session/Calls/CallVC+Camera.swift b/Session/Calls/CallVC+Camera.swift index 3370a1bff..17dc4f196 100644 --- a/Session/Calls/CallVC+Camera.swift +++ b/Session/Calls/CallVC+Camera.swift @@ -9,6 +9,6 @@ extension CallVC : CameraManagerDelegate { let timestampNs = Int64(timestamp * 1000000000) let frame = RTCVideoFrame(buffer: rtcPixelBuffer, rotation: RTCVideoRotation._0, timeStampNs: timestampNs) frame.timeStamp = Int32(timestamp) - webRTCWrapper.handleLocalFrameCaptured(frame) + webRTCSession.handleLocalFrameCaptured(frame) } } diff --git a/Session/Calls/CallVC.swift b/Session/Calls/CallVC.swift index 47ee0adeb..e6cf13de2 100644 --- a/Session/Calls/CallVC.swift +++ b/Session/Calls/CallVC.swift @@ -3,10 +3,10 @@ import SessionUIKit import SessionMessagingKit import SessionUtilitiesKit -final class CallVC : UIViewController, WebRTCWrapperDelegate { +final class CallVC : UIViewController, WebRTCSessionDelegate { let sessionID: String let mode: Mode - let webRTCWrapper: WebRTCWrapper + let webRTCSession: WebRTCSession lazy var cameraManager: CameraManager = { let result = CameraManager() @@ -15,7 +15,7 @@ final class CallVC : UIViewController, WebRTCWrapperDelegate { }() lazy var videoCapturer: RTCVideoCapturer = { - return RTCCameraVideoCapturer(delegate: webRTCWrapper.localVideoSource) + return RTCCameraVideoCapturer(delegate: webRTCSession.localVideoSource) }() // MARK: Mode @@ -28,9 +28,9 @@ final class CallVC : UIViewController, WebRTCWrapperDelegate { init(for sessionID: String, mode: Mode) { self.sessionID = sessionID self.mode = mode - self.webRTCWrapper = WebRTCWrapper.current ?? WebRTCWrapper(for: sessionID) + self.webRTCSession = WebRTCSession.current ?? WebRTCSession(for: sessionID) super.init(nibName: nil, bundle: nil) - self.webRTCWrapper.delegate = self + self.webRTCSession.delegate = self } required init(coder: NSCoder) { preconditionFailure("Use init(for:) instead.") } @@ -38,16 +38,16 @@ final class CallVC : UIViewController, WebRTCWrapperDelegate { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .black - WebRTCWrapper.current = webRTCWrapper + WebRTCSession.current = webRTCSession setUpViewHierarchy() cameraManager.prepare() touch(videoCapturer) if case .offer = mode { Storage.write { transaction in - self.webRTCWrapper.sendOffer(to: self.sessionID, using: transaction).retainUntilComplete() + self.webRTCSession.sendOffer(to: self.sessionID, using: transaction).retainUntilComplete() } } else if case let .answer(sdp) = mode { - webRTCWrapper.handleRemoteSDP(sdp, from: sessionID) // This sends an answer message internally + webRTCSession.handleRemoteSDP(sdp, from: sessionID) // This sends an answer message internally } } @@ -55,14 +55,14 @@ final class CallVC : UIViewController, WebRTCWrapperDelegate { // Remote video view let remoteVideoView = RTCMTLVideoView() remoteVideoView.contentMode = .scaleAspectFill - webRTCWrapper.attachRemoteRenderer(remoteVideoView) + webRTCSession.attachRemoteRenderer(remoteVideoView) view.addSubview(remoteVideoView) remoteVideoView.translatesAutoresizingMaskIntoConstraints = false remoteVideoView.pin(to: view) // Local video view let localVideoView = RTCMTLVideoView() localVideoView.contentMode = .scaleAspectFill - webRTCWrapper.attachLocalRenderer(localVideoView) + webRTCSession.attachLocalRenderer(localVideoView) localVideoView.set(.width, to: 80) localVideoView.set(.height, to: 173) view.addSubview(localVideoView) @@ -82,6 +82,6 @@ final class CallVC : UIViewController, WebRTCWrapperDelegate { } deinit { - WebRTCWrapper.current = nil + WebRTCSession.current = nil } } diff --git a/SessionMessagingKit/Calls/WebRTCWrapper+MessageHandling.swift b/SessionMessagingKit/Calls/WebRTCSession+MessageHandling.swift similarity index 97% rename from SessionMessagingKit/Calls/WebRTCWrapper+MessageHandling.swift rename to SessionMessagingKit/Calls/WebRTCSession+MessageHandling.swift index 57069ab42..ec860bb65 100644 --- a/SessionMessagingKit/Calls/WebRTCWrapper+MessageHandling.swift +++ b/SessionMessagingKit/Calls/WebRTCSession+MessageHandling.swift @@ -1,6 +1,6 @@ import WebRTC -extension WebRTCWrapper { +extension WebRTCSession { public func handleICECandidates(_ candidate: [RTCIceCandidate]) { print("[Calls] Received ICE candidate message.") diff --git a/SessionMessagingKit/Calls/WebRTCWrapper+UI.swift b/SessionMessagingKit/Calls/WebRTCSession+UI.swift similarity index 94% rename from SessionMessagingKit/Calls/WebRTCWrapper+UI.swift rename to SessionMessagingKit/Calls/WebRTCSession+UI.swift index 81255a0a2..7ed0a54e8 100644 --- a/SessionMessagingKit/Calls/WebRTCWrapper+UI.swift +++ b/SessionMessagingKit/Calls/WebRTCSession+UI.swift @@ -1,6 +1,6 @@ import WebRTC -extension WebRTCWrapper { +extension WebRTCSession { public func attachLocalRenderer(_ renderer: RTCVideoRenderer) { localVideoTrack.add(renderer) diff --git a/SessionMessagingKit/Calls/WebRTCWrapper.swift b/SessionMessagingKit/Calls/WebRTCSession.swift similarity index 97% rename from SessionMessagingKit/Calls/WebRTCWrapper.swift rename to SessionMessagingKit/Calls/WebRTCSession.swift index f0d55af3c..956c4f4ab 100644 --- a/SessionMessagingKit/Calls/WebRTCWrapper.swift +++ b/SessionMessagingKit/Calls/WebRTCSession.swift @@ -1,13 +1,13 @@ import PromiseKit import WebRTC -public protocol WebRTCWrapperDelegate : AnyObject { +public protocol WebRTCSessionDelegate : AnyObject { var videoCapturer: RTCVideoCapturer { get } } /// See https://webrtc.org/getting-started/overview for more information. -public final class WebRTCWrapper : NSObject, RTCPeerConnectionDelegate { - public weak var delegate: WebRTCWrapperDelegate? +public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate { + public weak var delegate: WebRTCSessionDelegate? private let contactSessionID: String private var queuedICECandidates: [RTCIceCandidate] = [] private var iceCandidateSendTimer: Timer? @@ -81,7 +81,7 @@ public final class WebRTCWrapper : NSObject, RTCPeerConnectionDelegate { } // MARK: Initialization - public static var current: WebRTCWrapper? + public static var current: WebRTCSession? public init(for contactSessionID: String) { self.contactSessionID = contactSessionID diff --git a/SessionMessagingKit/Messages/Control Messages/CallMessage.swift b/SessionMessagingKit/Messages/Control Messages/CallMessage.swift index c5fcdc62e..c1d4865a1 100644 --- a/SessionMessagingKit/Messages/Control Messages/CallMessage.swift +++ b/SessionMessagingKit/Messages/Control Messages/CallMessage.swift @@ -1,7 +1,5 @@ import WebRTC -// NOTE: Multiple ICE candidates may be batched together for performance - /// See https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription for more information. @objc(SNCallMessage) public final class CallMessage : ControlMessage { @@ -9,6 +7,8 @@ public final class CallMessage : ControlMessage { /// See https://developer.mozilla.org/en-US/docs/Glossary/SDP for more information. public var sdps: [String]? + // NOTE: Multiple ICE candidates may be batched together for performance + // MARK: Kind public enum Kind : Codable, CustomStringConvertible { case offer diff --git a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift index 9e0919e43..403dc2d2c 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift @@ -256,12 +256,12 @@ extension MessageReceiver { // MARK: - Call Messages public static func handleCallMessage(_ message: CallMessage, using transaction: Any) { - let webRTCWrapper: WebRTCWrapper - if let current = WebRTCWrapper.current { - webRTCWrapper = current + let webRTCSession: WebRTCSession + if let current = WebRTCSession.current { + webRTCSession = current } else { - WebRTCWrapper.current = WebRTCWrapper(for: message.sender!) - webRTCWrapper = WebRTCWrapper.current! + WebRTCSession.current = WebRTCSession(for: message.sender!) + webRTCSession = WebRTCSession.current! } switch message.kind! { case .offer: @@ -270,7 +270,7 @@ extension MessageReceiver { case .answer: print("[Calls] Received answer message.") let sdp = RTCSessionDescription(type: .answer, sdp: message.sdps![0]) - webRTCWrapper.handleRemoteSDP(sdp, from: message.sender!) + webRTCSession.handleRemoteSDP(sdp, from: message.sender!) case .provisionalAnswer: break // TODO: Implement case let .iceCandidates(sdpMLineIndexes, sdpMids): var candidates: [RTCIceCandidate] = [] @@ -282,7 +282,7 @@ extension MessageReceiver { let candidate = RTCIceCandidate(sdp: sdp, sdpMLineIndex: Int32(sdpMLineIndex), sdpMid: sdpMid) candidates.append(candidate) } - webRTCWrapper.handleICECandidates(candidates) + webRTCSession.handleICECandidates(candidates) } }