Signal-iOS/SignalMessaging/environment/NoopCallMessageHandler.swift
Jim Gustafson 6806bd4d9f Adjust protocol definitions
Added a new field destinationDeviceId to the protocol buffer for
CallMessage.

Added supporting logic of setting it when sending.

Added a catch when receiving: If the field is defined, then use it
and check the local deviceId and if not a match, drop the message
since it is not for this device.

Changed naming to be more explicit.

Removed the FeatureLevel definition from the protocol since proto enums
won't be backwards compatible if updated. Instead, adding boolean flags
instead. For this release, the feature supported is multi-ring, so a
multiRing flag is defined instead of a feature level.

The supportsMultiRing value is persisted through to RingRTC. There is
no more need to translate between the enumerations anymore.

Added prefix naming for proto enums since the namespace is shared.

Removed defaults since they are already the desired default values.

When sending messages, using a nullable unsigned integer type instead
of a flag and value pair. This simplifies the function calls, although
some NSNumber extensions were required on the Swift side.
2020-05-08 15:50:49 -07:00

30 lines
1.1 KiB
Swift

//
// Copyright (c) 2020 Open Whisper Systems. All rights reserved.
//
import SignalServiceKit
@objc
public class NoopCallMessageHandler: NSObject, OWSCallMessageHandler {
public func receivedOffer(_ offer: SSKProtoCallMessageOffer, from caller: SignalServiceAddress, sourceDevice device: UInt32, sentAtTimestamp: UInt64, supportsMultiRing: Bool) {
owsFailDebug("")
}
public func receivedAnswer(_ answer: SSKProtoCallMessageAnswer, from caller: SignalServiceAddress, sourceDevice device: UInt32, supportsMultiRing: Bool) {
owsFailDebug("")
}
public func receivedIceUpdate(_ iceUpdate: [SSKProtoCallMessageIceUpdate], from caller: SignalServiceAddress, sourceDevice device: UInt32) {
owsFailDebug("")
}
public func receivedHangup(_ hangup: SSKProtoCallMessageHangup, from caller: SignalServiceAddress, sourceDevice device: UInt32) {
owsFailDebug("")
}
public func receivedBusy(_ busy: SSKProtoCallMessageBusy, from caller: SignalServiceAddress, sourceDevice device: UInt32) {
owsFailDebug("")
}
}