|
|
@ -8,6 +8,7 @@
|
|
|
|
#import "SignalsNavigationController.h"
|
|
|
|
#import "SignalsNavigationController.h"
|
|
|
|
#import "SignalsViewController.h"
|
|
|
|
#import "SignalsViewController.h"
|
|
|
|
#import "StringUtil.h"
|
|
|
|
#import "StringUtil.h"
|
|
|
|
|
|
|
|
#import "UIViewController+OWS.h"
|
|
|
|
#import <PromiseKit/AnyPromise.h>
|
|
|
|
#import <PromiseKit/AnyPromise.h>
|
|
|
|
#import <SignalServiceKit/OWSError.h>
|
|
|
|
#import <SignalServiceKit/OWSError.h>
|
|
|
|
#import <SignalServiceKit/TSAccountManager.h>
|
|
|
|
#import <SignalServiceKit/TSAccountManager.h>
|
|
|
@ -260,8 +261,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
- (void)verifyChallengeAction:(nullable id)sender
|
|
|
|
- (void)verifyChallengeAction:(nullable id)sender
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[self startActivityIndicator];
|
|
|
|
[self startActivityIndicator];
|
|
|
|
|
|
|
|
OWSProdInfo(@"registration_registering_code");
|
|
|
|
[self.accountManager registerWithVerificationCode:[self validationCodeFromTextField]]
|
|
|
|
[self.accountManager registerWithVerificationCode:[self validationCodeFromTextField]]
|
|
|
|
.then(^{
|
|
|
|
.then(^{
|
|
|
|
|
|
|
|
OWSProdInfo(@"registration_registering_submitted_code");
|
|
|
|
|
|
|
|
|
|
|
|
DDLogInfo(@"%@ Successfully registered Signal account.", self.tag);
|
|
|
|
DDLogInfo(@"%@ Successfully registered Signal account.", self.tag);
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
[self stopActivityIndicator];
|
|
|
|
[self stopActivityIndicator];
|
|
|
@ -276,6 +280,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(^(NSError *_Nonnull error) {
|
|
|
|
.catch(^(NSError *_Nonnull error) {
|
|
|
|
|
|
|
|
OWSProdInfo(@"registration_registration_failed");
|
|
|
|
DDLogError(@"%@ error verifying challenge: %@", self.tag, error);
|
|
|
|
DDLogError(@"%@ error verifying challenge: %@", self.tag, error);
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
[self stopActivityIndicator];
|
|
|
|
[self stopActivityIndicator];
|
|
|
@ -319,6 +324,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
#pragma mark - Send codes again
|
|
|
|
#pragma mark - Send codes again
|
|
|
|
|
|
|
|
|
|
|
|
- (void)sendCodeViaSMSAction:(id)sender {
|
|
|
|
- (void)sendCodeViaSMSAction:(id)sender {
|
|
|
|
|
|
|
|
OWSProdInfo(@"registration_registering_requested_new_code_by_sms");
|
|
|
|
|
|
|
|
|
|
|
|
[self enableServerActions:NO];
|
|
|
|
[self enableServerActions:NO];
|
|
|
|
|
|
|
|
|
|
|
|
[_requestCodeAgainSpinner startAnimating];
|
|
|
|
[_requestCodeAgainSpinner startAnimating];
|
|
|
@ -336,6 +343,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)sendCodeViaVoiceAction:(id)sender {
|
|
|
|
- (void)sendCodeViaVoiceAction:(id)sender {
|
|
|
|
|
|
|
|
OWSProdInfo(@"registration_registering_requested_new_code_by_voice");
|
|
|
|
|
|
|
|
|
|
|
|
[self enableServerActions:NO];
|
|
|
|
[self enableServerActions:NO];
|
|
|
|
|
|
|
|
|
|
|
|
[_requestCallSpinner startAnimating];
|
|
|
|
[_requestCallSpinner startAnimating];
|
|
|
@ -365,6 +374,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)backButtonPressed:(id)sender {
|
|
|
|
- (void)backButtonPressed:(id)sender {
|
|
|
|
|
|
|
|
OWSProdInfo(@"registration_verification_back");
|
|
|
|
|
|
|
|
|
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|