session-ios/SessionMessagingKit/Calls/WebRTCSession+MessageHandling.swift
Morgan Pretty eeccfb47d5 Fixed all of the build errors from merge, migrated Call logic, started idBlinding migration and bug fixes
Fixed some broken file paths
Fixed a couple of bugs with closed groups
Fixed a few migration issues
Fixed a bug with the ProfilePictureView in open groups (was including the open parenthesis in the initials)
Migrated the Id Blinding changes to work with GRDB
Migrated the call logic to work with GRDB
Updated the code to work the with hard fork changes
2022-06-09 18:37:44 +10:00

28 lines
942 B
Swift

// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
import Foundation
import WebRTC
import SessionUtilitiesKit
extension WebRTCSession {
public func handleICECandidates(_ candidate: [RTCIceCandidate]) {
SNLog("[Calls] Received ICE candidate message.")
candidate.forEach { peerConnection?.add($0, completionHandler: { _ in }) }
}
public func handleRemoteSDP(_ sdp: RTCSessionDescription, from sessionId: String) {
SNLog("[Calls] Received remote SDP: \(sdp.sdp).")
peerConnection?.setRemoteDescription(sdp, completionHandler: { [weak self] error in
if let error = error {
SNLog("[Calls] Couldn't set SDP due to error: \(error).")
}
else {
guard sdp.type == .offer else { return }
self?.sendAnswer(to: sessionId).retainUntilComplete()
}
})
}
}