|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
// Created by Frederic Jacobs on 17/11/14.
|
|
|
|
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "SignalRecipient.h"
|
|
|
|
|
#import "TSStorageHeaders.h"
|
|
|
|
@ -15,8 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
- (instancetype)initWithTextSecureIdentifier:(NSString *)textSecureIdentifier
|
|
|
|
|
relay:(nullable NSString *)relay
|
|
|
|
|
supportsVoice:(BOOL)voiceCapable
|
|
|
|
|
supportsWebRTC:(BOOL)supportsWebRTC
|
|
|
|
|
{
|
|
|
|
|
self = [super initWithUniqueId:textSecureIdentifier];
|
|
|
|
|
if (!self) {
|
|
|
|
@ -25,8 +24,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
_devices = [NSMutableOrderedSet orderedSetWithObject:[NSNumber numberWithInt:1]];
|
|
|
|
|
_relay = [relay isEqualToString:@""] ? nil : relay;
|
|
|
|
|
_supportsVoice = voiceCapable;
|
|
|
|
|
_supportsWebRTC = supportsWebRTC;
|
|
|
|
|
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
@ -51,11 +48,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
SignalRecipient *myself = [self recipientWithTextSecureIdentifier:[TSStorageManager localNumber]];
|
|
|
|
|
if (!myself) {
|
|
|
|
|
myself = [[self alloc] initWithTextSecureIdentifier:[TSStorageManager localNumber]
|
|
|
|
|
relay:nil
|
|
|
|
|
supportsVoice:YES
|
|
|
|
|
// This property may be inaccurate, but it's fine since this will only be
|
|
|
|
|
// sent to the current user's other devices, which will ignore this value.
|
|
|
|
|
supportsWebRTC:YES];
|
|
|
|
|
relay:nil];
|
|
|
|
|
}
|
|
|
|
|
return myself;
|
|
|
|
|
}
|
|
|
|
@ -80,6 +73,16 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL)supportsVoice
|
|
|
|
|
{
|
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL)supportsWebRTC
|
|
|
|
|
{
|
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
|