Revert "Add WebRTC setting."

This reverts commit 0f45f292a1.

// FREEBIE
pull/1/head
Matthew Chen 9 years ago
parent 14a104b1b2
commit 254a247ba0

@ -64,7 +64,6 @@ static NSString *const TSRegistrationErrorUserInfoHTTPStatus = @"TSHTTPStatus";
+ (void)rerequestVoiceWithSuccess:(void (^)())successBlock failure:(void (^)(NSError *error))failureBlock;
- (void)verifyAccountWithCode:(NSString *)verificationCode
isWebRTCEnabled:(BOOL)isWebRTCEnabled
success:(void (^)())successBlock
failure:(void (^)(NSError *error))failureBlock;

@ -177,7 +177,6 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)verifyAccountWithCode:(NSString *)verificationCode
isWebRTCEnabled:(BOOL)isWebRTCEnabled
success:(void (^)())successBlock
failure:(void (^)(NSError *error))failureBlock
{
@ -192,8 +191,7 @@ NS_ASSUME_NONNULL_BEGIN
TSVerifyCodeRequest *request = [[TSVerifyCodeRequest alloc] initWithVerificationCode:verificationCode
forNumber:phoneNumber
signalingKey:signalingKey
authKey:authToken
isWebRTCEnabled:isWebRTCEnabled];
authKey:authToken];
[self.networkManager makeRequest:request
success:^(NSURLSessionDataTask *task, id responseObject) {

@ -10,10 +10,9 @@
@interface TSAttributes : NSObject
+ (NSDictionary *)attributesFromStorage:(BOOL)isWebRTCEnabled;
+ (NSDictionary *)attributesFromStorageWithVoiceSupport;
+ (NSDictionary *)attributesWithSignalingKey:(NSString *)signalingKey
serverAuthToken:(NSString *)authToken
isWebRTCEnabled:(BOOL)isWebRTCEnabled;
serverAuthToken:(NSString *)authToken;
@end

@ -13,21 +13,18 @@
@implementation TSAttributes
+ (NSDictionary *)attributesFromStorage:(BOOL)isWebRTCEnabled {
+ (NSDictionary *)attributesFromStorageWithVoiceSupport {
return [self attributesWithSignalingKey:[TSStorageManager signalingKey]
serverAuthToken:[TSStorageManager serverAuthToken]
isWebRTCEnabled:isWebRTCEnabled];
serverAuthToken:[TSStorageManager serverAuthToken]];
}
+ (NSDictionary *)attributesWithSignalingKey:(NSString *)signalingKey
serverAuthToken:(NSString *)authToken
isWebRTCEnabled:(BOOL)isWebRTCEnabled
{
return @{
@"signalingKey" : signalingKey,
@"AuthKey" : authToken,
@"voice" : @(YES), // all Signal-iOS clients support voice
@"video" : @(isWebRTCEnabled),
@"voice" : [NSNumber numberWithBool:YES], // all Signal-iOS clients support voice
@"registrationId" : [NSString stringWithFormat:@"%i", [TSAccountManager getOrGenerateRegistrationId]]
};
}

@ -10,6 +10,6 @@
@interface TSUpdateAttributesRequest : TSRequest
- (instancetype)initWithUpdatedAttributes:(BOOL)isWebRTCEnabled;
- (instancetype)initWithUpdatedAttributesWithVoice;
@end

@ -12,13 +12,13 @@
@implementation TSUpdateAttributesRequest
- (instancetype)initWithUpdatedAttributes:(BOOL)isWebRTCEnabled {
- (instancetype)initWithUpdatedAttributesWithVoice {
NSString *endPoint = [textSecureAccountsAPI stringByAppendingString:textSecureAttributesAPI];
self = [super initWithURL:[NSURL URLWithString:endPoint]];
if (self) {
[self setHTTPMethod:@"PUT"];
[self.parameters addEntriesFromDictionary:[TSAttributes attributesFromStorage:isWebRTCEnabled]];
[self.parameters addEntriesFromDictionary:[TSAttributes attributesFromStorageWithVoiceSupport]];
}
return self;

@ -13,8 +13,7 @@
- (TSRequest *)initWithVerificationCode:(NSString *)verificationCode
forNumber:(NSString *)phoneNumber
signalingKey:(NSString *)signalingKey
authKey:(NSString *)authKey
isWebRTCEnabled:(BOOL)isWebRTCEnabled;
authKey:(NSString *)authKey;
@property (nonatomic, readonly) NSString *numberToValidate;

@ -16,16 +16,13 @@
- (TSRequest *)initWithVerificationCode:(NSString *)verificationCode
forNumber:(NSString *)phoneNumber
signalingKey:(NSString *)signalingKey
authKey:(NSString *)authKey
isWebRTCEnabled:(BOOL)isWebRTCEnabled {
authKey:(NSString *)authKey {
self = [super
initWithURL:[NSURL URLWithString:[NSString
stringWithFormat:@"%@/code/%@", textSecureAccountsAPI, verificationCode]]];
NSDictionary *attributes =
[TSAttributes attributesWithSignalingKey:signalingKey
serverAuthToken:authKey
isWebRTCEnabled:isWebRTCEnabled];
[TSAttributes attributesWithSignalingKey:signalingKey serverAuthToken:authKey];
_numberToValidate = phoneNumber;
[self.parameters addEntriesFromDictionary:attributes];

Loading…
Cancel
Save