From b508135c3f82268b971cd32b341ac35eccc8d79b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 24 Nov 2016 11:25:21 +0100 Subject: [PATCH] Repair Check sms code --- Classes/AssistantView.m | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 7475c27da..35e6b025b 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -836,7 +836,8 @@ static UICompositeViewDescription *compositeDescription = nil; handler:^(UIAlertAction * action) { [PhoneMainView.instance popToView:DialerView.compositeViewDescription]; }]; - + + defaultAction.accessibilityLabel = @"PopUpResp"; [errView addAction:defaultAction]; [errView addAction:continueAction]; [self presentViewController:errView animated:YES completion:nil]; @@ -875,6 +876,11 @@ static UICompositeViewDescription *compositeDescription = nil; inView:_linphoneLoginView ofType:[UIAssistantTextField class]]) .text = [NSString stringWithUTF8String:nationnal_significant_number]; + ((UITextField *)[self findView:ViewElement_SMSCode + inView:_createAccountActivateSMSView + ofType:[UITextField class]]) + .text = @""; + linphone_account_creator_set_activation_code(account_creator, ""); NSDictionary *country = [CountryListView countryWithIso:[NSString stringWithUTF8String:dialplan.iso_country_code]]; [self didSelectCountry:country]; @@ -883,6 +889,7 @@ static UICompositeViewDescription *compositeDescription = nil; dialplan.ccc); }]; + defaultAction.accessibilityLabel = @"PopUpResp"; [errView addAction:defaultAction]; [self presentViewController:errView animated:YES completion:nil]; } else { @@ -894,6 +901,7 @@ static UICompositeViewDescription *compositeDescription = nil; handler:^(UIAlertAction * action) {}]; [errView addAction:defaultAction]; + defaultAction.accessibilityLabel = @"PopUpResp"; [self presentViewController:errView animated:YES completion:nil]; } } @@ -907,10 +915,15 @@ static UICompositeViewDescription *compositeDescription = nil; _outgoingView = AssistantLinkView.compositeViewDescription; [self configureProxyConfig]; } else { - if (linphone_account_creator_get_username(account_creator) && (strcmp(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == 0)) { - [self showErrorPopup:"ERROR_BAD_CREDENTIALS"]; + if (resp) { + if (linphone_account_creator_get_username(account_creator) && + (strcmp(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == 0)) { + [self showErrorPopup:"ERROR_BAD_CREDENTIALS"]; + } else { + [self showErrorPopup:resp]; + } } else { - [self showErrorPopup:resp]; + [self showErrorPopup:""]; } } } else { @@ -1156,7 +1169,6 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun - (IBAction)onCreateAccountActivationClick:(id)sender { ONCLICKBUTTON(sender, 100, { _waitView.hidden = NO; - ((UITextField *)[self findView:ViewElement_SMSCode inView:_contentView ofType:UITextField.class]).text = @""; linphone_account_creator_set_activation_code( account_creator, ((UITextField *)[self findView:ViewElement_SMSCode inView:_contentView ofType:UITextField.class])