Signal-iOS/SignalServiceKit/src/TestUtils/OWSFakeCallMessageHandler.m
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

56 lines
1.2 KiB
Objective-C

//
// Copyright (c) 2020 Open Whisper Systems. All rights reserved.
//
#import "OWSFakeCallMessageHandler.h"
NS_ASSUME_NONNULL_BEGIN
#ifdef TESTABLE_BUILD
@implementation OWSFakeCallMessageHandler
- (void)receivedOffer:(SSKProtoCallMessageOffer *)offer
fromCaller:(SignalServiceAddress *)caller
sourceDevice:(uint32_t)device
sentAtTimestamp:(uint64_t)sentAtTimestamp
supportsMultiRing:(BOOL)supportsMultiRing
{
OWSLogInfo(@"");
}
- (void)receivedAnswer:(SSKProtoCallMessageAnswer *)answer
fromCaller:(SignalServiceAddress *)caller
sourceDevice:(uint32_t)device
supportsMultiRing:(BOOL)supportsMultiRing
{
OWSLogInfo(@"");
}
- (void)receivedIceUpdate:(SSKProtoCallMessageIceUpdate *)iceUpdate
fromCaller:(SignalServiceAddress *)caller
sourceDevice:(uint32_t)device
{
OWSLogInfo(@"");
}
- (void)receivedHangup:(SSKProtoCallMessageHangup *)hangup
fromCaller:(SignalServiceAddress *)caller
sourceDevice:(uint32_t)device
{
OWSLogInfo(@"");
}
- (void)receivedBusy:(SSKProtoCallMessageBusy *)busy
fromCaller:(SignalServiceAddress *)caller
sourceDevice:(uint32_t)device
{
OWSLogInfo(@"");
}
@end
#endif
NS_ASSUME_NONNULL_END