mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 15:48:09 +00:00
Set language in assistant for validation sms + update submodule linphone
This commit is contained in:
parent
bdd24f1b38
commit
0ed0b8f258
3 changed files with 32 additions and 5 deletions
|
|
@ -138,7 +138,7 @@ void assistant_link_phone_number_with_account(LinphoneAccountCreator *creator, L
|
|||
thiz.linkAccountView.hidden = thiz.activateSMSView.userInteractionEnabled = YES;
|
||||
thiz.activateSMSView.hidden = thiz.linkAccountView.userInteractionEnabled = NO;
|
||||
} else {
|
||||
if (strcmp(resp, "Missing required parameters") ==0) {
|
||||
if (strcmp(resp, "Missing required parameters") == 0) {
|
||||
[thiz showErrorPopup:"ERROR_NO_PHONE_NUMBER"];
|
||||
} else {
|
||||
[thiz showErrorPopup:resp];
|
||||
|
|
@ -173,6 +173,17 @@ void assistant_activate_phone_number_link(LinphoneAccountCreator *creator, Linph
|
|||
[_countryButton setTitle:c ? [c objectForKey:@"name"] : NSLocalizedString(@"Unknown country code", nil)
|
||||
forState:UIControlStateNormal];
|
||||
}
|
||||
if ([[_countryButton currentTitle] isEqualToString:@"Unknown country code"]) {
|
||||
_countryCodeField.layer.borderWidth = .8;
|
||||
_countryCodeField.layer.cornerRadius = 4.f;
|
||||
_countryCodeField.layer.borderColor = [[UIColor redColor] CGColor];
|
||||
self.linkAccountButton.enabled = FALSE;
|
||||
} else {
|
||||
_countryCodeField.layer.borderColor = [[UIColor clearColor] CGColor];
|
||||
if (_phoneField.layer.borderColor != [[UIColor redColor] CGColor]) {
|
||||
self.linkAccountButton.enabled = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onCountryCodeFieldChange:(id)sender {
|
||||
|
|
@ -194,6 +205,9 @@ void assistant_activate_phone_number_link(LinphoneAccountCreator *creator, Linph
|
|||
NSString *newStr = [_countryCodeField.text substringWithRange:NSMakeRange(1, [_countryCodeField.text length]-1)];
|
||||
linphone_account_creator_set_phone_number(account_creator, _phoneField.text.UTF8String,
|
||||
newStr.UTF8String);
|
||||
|
||||
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
|
||||
linphone_account_creator_set_language(account_creator, [[language substringToIndex:2] UTF8String]);
|
||||
linphone_account_creator_link_phone_number_with_account(account_creator);
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +260,9 @@ void assistant_activate_phone_number_link(LinphoneAccountCreator *creator, Linph
|
|||
self.linkAccountButton.enabled = FALSE;
|
||||
} else {
|
||||
self.phoneField.layer.borderColor = [[UIColor clearColor] CGColor];
|
||||
self.linkAccountButton.enabled = TRUE;
|
||||
if (_countryCodeField.layer.borderColor != [[UIColor redColor] CGColor]){
|
||||
self.linkAccountButton.enabled = TRUE;
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||
|
||||
}
|
||||
|
||||
- (void)fitContent {
|
||||
|
|
@ -797,6 +798,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
if (status == LinphoneAccountCreatorAccountExist || status == LinphoneAccountCreatorAccountExistWithAlias) {
|
||||
linphone_account_creator_is_account_activated(account_creator);
|
||||
} else if (status == LinphoneAccountCreatorAccountNotExist) {
|
||||
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
|
||||
linphone_account_creator_set_language(account_creator, [[language substringToIndex:2] UTF8String]);
|
||||
linphone_account_creator_create_account(account_creator);
|
||||
} else {
|
||||
[self showErrorPopup:resp];
|
||||
|
|
@ -866,6 +869,8 @@ void assistant_is_account_activated(LinphoneAccountCreator *creator, LinphoneAcc
|
|||
[thiz showErrorPopup:"ERROR_ACCOUNT_ALREADY_IN_USE"];
|
||||
[thiz findButton:ViewElement_NextButton].enabled = NO;
|
||||
} else {
|
||||
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
|
||||
linphone_account_creator_set_language(creator, [[language substringToIndex:2] UTF8String]);
|
||||
linphone_account_creator_recover_phone_account(creator);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1001,8 +1006,10 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun
|
|||
linphone_account_creator_get_ha1(account_creator) == NULL) {
|
||||
linphone_account_creator_activate_account(account_creator);
|
||||
} else {
|
||||
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
|
||||
linphone_account_creator_set_language(account_creator, [[language substringToIndex:2] UTF8String]);
|
||||
linphone_account_creator_link_phone_number_with_account(account_creator);
|
||||
linphone_account_creator_link_phone_number_with_account(account_creator);
|
||||
linphone_account_creator_activate_phone_number_link(account_creator);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1010,13 +1017,15 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun
|
|||
- (IBAction)onCreateAccountCheckActivatedClick:(id)sender {
|
||||
ONCLICKBUTTON(sender, 100, {
|
||||
_waitView.hidden = NO;
|
||||
linphone_account_creator_is_account_linked(account_creator);
|
||||
linphone_account_creator_is_account_activated(account_creator);
|
||||
});
|
||||
}
|
||||
|
||||
- (IBAction)onLinkAccountClick:(id)sender {
|
||||
ONCLICKBUTTON(sender, 100, {
|
||||
_waitView.hidden = NO;
|
||||
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
|
||||
linphone_account_creator_set_language(account_creator, [[language substringToIndex:2] UTF8String]);
|
||||
linphone_account_creator_link_phone_number_with_account(account_creator);
|
||||
});
|
||||
}
|
||||
|
|
@ -1028,6 +1037,8 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun
|
|||
if ((linphone_account_creator_get_phone_number(account_creator) != NULL) &&
|
||||
linphone_account_creator_get_password(account_creator) == NULL &&
|
||||
linphone_account_creator_get_ha1(account_creator) == NULL) {
|
||||
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
|
||||
linphone_account_creator_set_language(account_creator, [[language substringToIndex:2] UTF8String]);
|
||||
linphone_account_creator_recover_phone_account(account_creator);
|
||||
} else {
|
||||
// check if account is already linked with a phone number.
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 0a9176ebbacdf22aeb4ee5d73b50ced25d186d9b
|
||||
Subproject commit 8958eaa2b51b1203d406009495774b56d20d5f83
|
||||
Loading…
Add table
Reference in a new issue