From f4a11f0c6fc3026b1c9b86a5bc36a0bc34468a1f Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 7 Aug 2018 14:47:35 -0400 Subject: [PATCH] Respond to CR. --- Signal/src/call/CallService.swift | 33 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Signal/src/call/CallService.swift b/Signal/src/call/CallService.swift index 129e2c828..ac1656efb 100644 --- a/Signal/src/call/CallService.swift +++ b/Signal/src/call/CallService.swift @@ -408,10 +408,10 @@ private class SignalCallData: NSObject { } return peerConnectionClient.setLocalSessionDescription(sessionDescription).then { - let offerBuilder = SSKProtoCallMessageOffer.SSKProtoCallMessageOfferBuilder() - offerBuilder.setId(call.signalingId) - offerBuilder.setSessionDescription(sessionDescription.sdp) do { + let offerBuilder = SSKProtoCallMessageOffer.SSKProtoCallMessageOfferBuilder() + offerBuilder.setId(call.signalingId) + offerBuilder.setSessionDescription(sessionDescription.sdp) let offer = try offerBuilder.build() let callMessage = OWSOutgoingCallMessage(thread: call.thread, offerMessage: offer) return self.messageSender.sendPromise(message: callMessage) @@ -719,10 +719,10 @@ private class SignalCallData: NSObject { throw CallError.obsoleteCall(description: "negotiateSessionDescription() response for obsolete call") } - let answerBuilder = SSKProtoCallMessageAnswer.SSKProtoCallMessageAnswerBuilder() - answerBuilder.setId(newCall.signalingId) - answerBuilder.setSessionDescription(negotiatedSessionDescription.sdp) do { + let answerBuilder = SSKProtoCallMessageAnswer.SSKProtoCallMessageAnswerBuilder() + answerBuilder.setId(newCall.signalingId) + answerBuilder.setSessionDescription(negotiatedSessionDescription.sdp) let answer = try answerBuilder.build() 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).") - /** - * 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 - * exchanged, the clients can connect directly. - */ - let iceUpdateBuilder = SSKProtoCallMessageIceUpdate.SSKProtoCallMessageIceUpdateBuilder() - iceUpdateBuilder.setId(call.signalingId) - iceUpdateBuilder.setSdp(iceCandidate.sdp) - iceUpdateBuilder.setSdpMlineIndex(UInt32(iceCandidate.sdpMLineIndex)) - iceUpdateBuilder.setSdpMid(sdpMid) do { + /** + * 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 + * exchanged, the clients can connect. + */ + let iceUpdateBuilder = SSKProtoCallMessageIceUpdate.SSKProtoCallMessageIceUpdateBuilder() + iceUpdateBuilder.setId(call.signalingId) + iceUpdateBuilder.setSdp(iceCandidate.sdp) + iceUpdateBuilder.setSdpMlineIndex(UInt32(iceCandidate.sdpMLineIndex)) + iceUpdateBuilder.setSdpMid(sdpMid) let iceUpdate = try iceUpdateBuilder.build() 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. - do { let hangupBuilder = SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder() hangupBuilder.setId(call.signalingId)