mirror of https://github.com/oxen-io/session-ios
Merge branch 'charlesmchen/callWrappers'
commit
01268f0160
@ -1 +1 @@
|
||||
Subproject commit 38d58dc5ecdb591023706e2240cfde92a39c1968
|
||||
Subproject commit b9d00f47530c6c0c219b6c8cfe1802216f3093b9
|
@ -1,23 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SSKProtoCallMessageAnswer;
|
||||
|
||||
/**
|
||||
* Sent by the call recipient upon accepting a CallOffer
|
||||
*/
|
||||
@interface OWSCallAnswerMessage : NSObject
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId sessionDescription:(NSString *)sessionDescription;
|
||||
|
||||
@property (nonatomic, readonly) UInt64 callId;
|
||||
@property (nonatomic, readonly, copy) NSString *sessionDescription;
|
||||
|
||||
- (nullable SSKProtoCallMessageAnswer *)asProtobuf;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,43 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSCallAnswerMessage.h"
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSCallAnswerMessage
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId sessionDescription:(NSString *)sessionDescription
|
||||
{
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
_callId = callId;
|
||||
_sessionDescription = sessionDescription;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (nullable SSKProtoCallMessageAnswer *)asProtobuf
|
||||
{
|
||||
SSKProtoCallMessageAnswerBuilder *builder = [SSKProtoCallMessageAnswerBuilder new];
|
||||
|
||||
builder.id = self.callId;
|
||||
builder.sessionDescription = self.sessionDescription;
|
||||
|
||||
NSError *error;
|
||||
SSKProtoCallMessageAnswer *_Nullable result = [builder buildAndReturnError:&error];
|
||||
if (error || !result) {
|
||||
OWSFail(@"%@ could not build protobuf: %@", self.logTag, error);
|
||||
return nil;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,24 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSOutgoingCallMessage.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SSKProtoCallMessageBusy;
|
||||
|
||||
/**
|
||||
* Sent by the call recipient after receiving a call offer when they are already in a call.
|
||||
*/
|
||||
@interface OWSCallBusyMessage : OWSOutgoingCallMessage
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId;
|
||||
|
||||
@property (nonatomic, readonly) UInt64 callId;
|
||||
|
||||
- (nullable SSKProtoCallMessageBusy *)asProtobuf;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,41 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSCallBusyMessage.h"
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSCallBusyMessage
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId
|
||||
{
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
_callId = callId;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (nullable SSKProtoCallMessageBusy *)asProtobuf
|
||||
{
|
||||
SSKProtoCallMessageBusyBuilder *builder = [SSKProtoCallMessageBusyBuilder new];
|
||||
|
||||
builder.id = self.callId;
|
||||
|
||||
NSError *error;
|
||||
SSKProtoCallMessageBusy *_Nullable result = [builder buildAndReturnError:&error];
|
||||
if (error || !result) {
|
||||
OWSFail(@"%@ could not build protobuf: %@", self.logTag, error);
|
||||
return nil;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,24 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSOutgoingCallMessage.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SSKProtoCallMessageHangup;
|
||||
|
||||
/**
|
||||
* Sent by either party in a call to indicate the user intentionally ended the call.
|
||||
*/
|
||||
@interface OWSCallHangupMessage : OWSOutgoingCallMessage
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId;
|
||||
|
||||
@property (nonatomic, readonly) UInt64 callId;
|
||||
|
||||
- (nullable SSKProtoCallMessageHangup *)asProtobuf;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,42 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSCallHangupMessage.h"
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSCallHangupMessage
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId
|
||||
{
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
_callId = callId;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (nullable SSKProtoCallMessageHangup *)asProtobuf
|
||||
{
|
||||
SSKProtoCallMessageHangupBuilder *builder = [SSKProtoCallMessageHangupBuilder new];
|
||||
|
||||
builder.id = self.callId;
|
||||
|
||||
NSError *error;
|
||||
SSKProtoCallMessageHangup *_Nullable result = [builder buildAndReturnError:&error];
|
||||
if (error || !result) {
|
||||
OWSFail(@"%@ could not build protobuf: %@", self.logTag, error);
|
||||
return nil;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,30 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SSKProtoCallMessageIceUpdate;
|
||||
|
||||
/**
|
||||
* Sent by both parties out of band of the RTC calling channels, as part of setting up those channels. The messages
|
||||
* include network accessability information from the perspective of each client. Once compatible ICEUpdates have been
|
||||
* exchanged, the clients can connect directly.
|
||||
*/
|
||||
@interface OWSCallIceUpdateMessage : NSObject
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId
|
||||
sdp:(NSString *)sdp
|
||||
sdpMLineIndex:(SInt32)sdpMLineIndex
|
||||
sdpMid:(nullable NSString *)sdpMid;
|
||||
|
||||
@property (nonatomic, readonly) UInt64 callId;
|
||||
@property (nonatomic, readonly, copy) NSString *sdp;
|
||||
@property (nonatomic, readonly) SInt32 sdpMLineIndex;
|
||||
@property (nullable, nonatomic, readonly, copy) NSString *sdpMid;
|
||||
|
||||
- (nullable SSKProtoCallMessageIceUpdate *)asProtobuf;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,47 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSCallIceUpdateMessage.h"
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
|
||||
@implementation OWSCallIceUpdateMessage
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId
|
||||
sdp:(NSString *)sdp
|
||||
sdpMLineIndex:(SInt32)sdpMLineIndex
|
||||
sdpMid:(nullable NSString *)sdpMid
|
||||
{
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
_callId = callId;
|
||||
_sdp = sdp;
|
||||
_sdpMLineIndex = sdpMLineIndex;
|
||||
_sdpMid = sdpMid;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (nullable SSKProtoCallMessageIceUpdate *)asProtobuf
|
||||
{
|
||||
SSKProtoCallMessageIceUpdateBuilder *builder =
|
||||
[SSKProtoCallMessageIceUpdateBuilder new];
|
||||
|
||||
[builder setId:self.callId];
|
||||
[builder setSdp:self.sdp];
|
||||
[builder setSdpMlineIndex:self.sdpMLineIndex];
|
||||
[builder setSdpMid:self.sdpMid];
|
||||
|
||||
NSError *error;
|
||||
SSKProtoCallMessageIceUpdate *_Nullable result = [builder buildAndReturnError:&error];
|
||||
if (error || !result) {
|
||||
OWSFail(@"%@ could not build protobuf: %@", self.logTag, error);
|
||||
return nil;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
@ -1,23 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SSKProtoCallMessageOffer;
|
||||
|
||||
/**
|
||||
* Sent by the call initiator to Signal their intention to set up a call with the recipient.
|
||||
*/
|
||||
@interface OWSCallOfferMessage : NSObject
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId sessionDescription:(NSString *)sessionDescription;
|
||||
|
||||
@property (nonatomic, readonly) UInt64 callId;
|
||||
@property (nonatomic, readonly, copy) NSString *sessionDescription;
|
||||
|
||||
- (nullable SSKProtoCallMessageOffer *)asProtobuf;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,43 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSCallOfferMessage.h"
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSCallOfferMessage
|
||||
|
||||
- (instancetype)initWithCallId:(UInt64)callId sessionDescription:(NSString *)sessionDescription
|
||||
{
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
_callId = callId;
|
||||
_sessionDescription = sessionDescription;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (nullable SSKProtoCallMessageOffer *)asProtobuf
|
||||
{
|
||||
SSKProtoCallMessageOfferBuilder *builder = [SSKProtoCallMessageOfferBuilder new];
|
||||
|
||||
builder.id = self.callId;
|
||||
builder.sessionDescription = self.sessionDescription;
|
||||
|
||||
NSError *error;
|
||||
SSKProtoCallMessageOffer *_Nullable result = [builder buildAndReturnError:&error];
|
||||
if (error || !result) {
|
||||
OWSFail(@"%@ could not build protobuf: %@", self.logTag, error);
|
||||
return nil;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
Loading…
Reference in New Issue