Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent dc012d46e4
commit f4a11f0c6f

@ -408,10 +408,10 @@ private class SignalCallData: NSObject {
} }
return peerConnectionClient.setLocalSessionDescription(sessionDescription).then { return peerConnectionClient.setLocalSessionDescription(sessionDescription).then {
do {
let offerBuilder = SSKProtoCallMessageOffer.SSKProtoCallMessageOfferBuilder() let offerBuilder = SSKProtoCallMessageOffer.SSKProtoCallMessageOfferBuilder()
offerBuilder.setId(call.signalingId) offerBuilder.setId(call.signalingId)
offerBuilder.setSessionDescription(sessionDescription.sdp) offerBuilder.setSessionDescription(sessionDescription.sdp)
do {
let offer = try offerBuilder.build() let offer = try offerBuilder.build()
let callMessage = OWSOutgoingCallMessage(thread: call.thread, offerMessage: offer) let callMessage = OWSOutgoingCallMessage(thread: call.thread, offerMessage: offer)
return self.messageSender.sendPromise(message: callMessage) return self.messageSender.sendPromise(message: callMessage)
@ -719,10 +719,10 @@ private class SignalCallData: NSObject {
throw CallError.obsoleteCall(description: "negotiateSessionDescription() response for obsolete call") throw CallError.obsoleteCall(description: "negotiateSessionDescription() response for obsolete call")
} }
do {
let answerBuilder = SSKProtoCallMessageAnswer.SSKProtoCallMessageAnswerBuilder() let answerBuilder = SSKProtoCallMessageAnswer.SSKProtoCallMessageAnswerBuilder()
answerBuilder.setId(newCall.signalingId) answerBuilder.setId(newCall.signalingId)
answerBuilder.setSessionDescription(negotiatedSessionDescription.sdp) answerBuilder.setSessionDescription(negotiatedSessionDescription.sdp)
do {
let answer = try answerBuilder.build() let answer = try answerBuilder.build()
let callAnswerMessage = OWSOutgoingCallMessage(thread: thread, answerMessage: answer) let callAnswerMessage = OWSOutgoingCallMessage(thread: thread, answerMessage: answer)
@ -860,17 +860,17 @@ private class SignalCallData: NSObject {
Logger.info("\(self.logTag) in \(#function) sending ICE Candidate \(call.identifiersForLogs).") Logger.info("\(self.logTag) in \(#function) sending ICE Candidate \(call.identifiersForLogs).")
do {
/** /**
* Sent by both parties out of band of the RTC calling channels, as part of setting up those channels. The messages * Sent by both parties out of band of the RTC calling channels, as part of setting up those channels. The messages
* include network accessibility information from the perspective of each client. Once compatible ICEUpdates have been * include network accessibility information from the perspective of each client. Once compatible ICEUpdates have been
* exchanged, the clients can connect directly. * exchanged, the clients can connect.
*/ */
let iceUpdateBuilder = SSKProtoCallMessageIceUpdate.SSKProtoCallMessageIceUpdateBuilder() let iceUpdateBuilder = SSKProtoCallMessageIceUpdate.SSKProtoCallMessageIceUpdateBuilder()
iceUpdateBuilder.setId(call.signalingId) iceUpdateBuilder.setId(call.signalingId)
iceUpdateBuilder.setSdp(iceCandidate.sdp) iceUpdateBuilder.setSdp(iceCandidate.sdp)
iceUpdateBuilder.setSdpMlineIndex(UInt32(iceCandidate.sdpMLineIndex)) iceUpdateBuilder.setSdpMlineIndex(UInt32(iceCandidate.sdpMLineIndex))
iceUpdateBuilder.setSdpMid(sdpMid) iceUpdateBuilder.setSdpMid(sdpMid)
do {
let iceUpdate = try iceUpdateBuilder.build() let iceUpdate = try iceUpdateBuilder.build()
let callMessage = OWSOutgoingCallMessage(thread: call.thread, iceUpdateMessage: iceUpdate) let callMessage = OWSOutgoingCallMessage(thread: call.thread, iceUpdateMessage: iceUpdate)
@ -1208,7 +1208,6 @@ private class SignalCallData: NSObject {
} }
// If the call hasn't started yet, we don't have a data channel to communicate the hang up. Use Signal Service Message. // If the call hasn't started yet, we don't have a data channel to communicate the hang up. Use Signal Service Message.
do { do {
let hangupBuilder = SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder() let hangupBuilder = SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder()
hangupBuilder.setId(call.signalingId) hangupBuilder.setId(call.signalingId)

Loading…
Cancel
Save