Resolve more errors

voice-calls
Niels Andriesse 4 years ago
parent b22f66bab3
commit b3a64bf9fb

@ -278,7 +278,7 @@ protocol CallAudioServiceDelegate: AnyObject {
AssertIsOnMainThread() AssertIsOnMainThread()
Logger.debug("") Logger.debug("")
play(sound: .callEnded) play(sound: .callFailure)
handleCallEnded(call: call) handleCallEnded(call: call)
} }
@ -286,7 +286,7 @@ protocol CallAudioServiceDelegate: AnyObject {
AssertIsOnMainThread() AssertIsOnMainThread()
Logger.debug("") Logger.debug("")
play(sound: .callEnded) play(sound: .callFailure)
handleCallEnded(call: call) handleCallEnded(call: call)
} }
@ -296,7 +296,7 @@ protocol CallAudioServiceDelegate: AnyObject {
vibrate() vibrate()
play(sound: .callEnded) play(sound: .callFailure)
handleCallEnded(call: call) handleCallEnded(call: call)
} }
@ -316,7 +316,7 @@ protocol CallAudioServiceDelegate: AnyObject {
AssertIsOnMainThread() AssertIsOnMainThread()
Logger.debug("") Logger.debug("")
play(sound: .callEnded) play(sound: .callFailure)
handleCallEnded(call: call) handleCallEnded(call: call)
} }
@ -348,12 +348,12 @@ protocol CallAudioServiceDelegate: AnyObject {
stopRinging() stopRinging()
} }
private func prepareToPlay(sound: OWSStandardSound) -> OWSAudioPlayer? { private func prepareToPlay(sound: OWSSound) -> OWSAudioPlayer? {
guard let newPlayer = OWSSounds.audioPlayer(forSound: sound.rawValue, audioBehavior: .call) else { guard let newPlayer = OWSSounds.audioPlayer(for: sound, audioBehavior: .call) else {
owsFailDebug("unable to build player for sound: \(OWSSounds.displayName(forSound: sound.rawValue))") owsFailDebug("unable to build player for sound: \(OWSSounds.displayName(for: sound))")
return nil return nil
} }
Logger.info("playing sound: \(OWSSounds.displayName(forSound: sound.rawValue))") Logger.info("playing sound: \(OWSSounds.displayName(for: sound))")
// It's important to stop the current player **before** starting the new player. In the case that // It's important to stop the current player **before** starting the new player. In the case that
// we're playing the same sound, since the player is memoized on the sound instance, we'd otherwise // we're playing the same sound, since the player is memoized on the sound instance, we'd otherwise
@ -364,7 +364,7 @@ protocol CallAudioServiceDelegate: AnyObject {
return newPlayer return newPlayer
} }
private func play(sound: OWSStandardSound) { private func play(sound: OWSSound) {
guard let newPlayer = prepareToPlay(sound: sound) else { return } guard let newPlayer = prepareToPlay(sound: sound) else { return }
newPlayer.play() newPlayer.play()
} }

@ -109,7 +109,7 @@ public class SignalCall: NSObject, CallManagerCallReference {
case messageSendFailure(underlyingError: Error) case messageSendFailure(underlyingError: Error)
} }
var participantAddresses: [SignalServiceAddress] { var participantAddresses: [String] {
switch mode { switch mode {
case .group(let call): case .group(let call):
return call.remoteDeviceStates.values.map { $0.address } return call.remoteDeviceStates.values.map { $0.address }
@ -132,7 +132,7 @@ public class SignalCall: NSObject, CallManagerCallReference {
init(individualCall: IndividualCall) { init(individualCall: IndividualCall) {
mode = .individual(individualCall) mode = .individual(individualCall)
audioActivity = AudioActivity( audioActivity = AudioActivity(
audioDescription: "[SignalCall] with individual \(individualCall.remoteAddress)", audioDescription: "[SignalCall] with individual \(individualCall.thread.contactSessionID())",
behavior: .call behavior: .call
) )
thread = individualCall.thread thread = individualCall.thread
@ -174,7 +174,7 @@ public class SignalCall: NSObject, CallManagerCallReference {
public class func incomingIndividualCall( public class func incomingIndividualCall(
localId: UUID, localId: UUID,
remoteAddress: SignalServiceAddress, publicKey: String,
sentAtTimestamp: UInt64, sentAtTimestamp: UInt64,
offerMediaType: TSRecentCallOfferType offerMediaType: TSRecentCallOfferType
) -> SignalCall { ) -> SignalCall {
@ -195,7 +195,7 @@ public class SignalCall: NSObject, CallManagerCallReference {
direction: .incoming, direction: .incoming,
localId: localId, localId: localId,
state: .answering, state: .answering,
remoteAddress: remoteAddress, publicKey: publicKey,
sentAtTimestamp: sentAtTimestamp, sentAtTimestamp: sentAtTimestamp,
callAdapterType: callAdapterType callAdapterType: callAdapterType
) )

Loading…
Cancel
Save