diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 4807623ef..6f44ae0e0 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -169,6 +169,7 @@ static UICompositeViewDescription *compositeDescription = nil; assistant_recover_phone_account); linphone_account_creator_cbs_set_is_account_linked(linphone_account_creator_get_callbacks(account_creator), assistant_is_account_linked); + linphone_account_creator_cbs_set_login_linphone_account(linphone_account_creator_get_callbacks(account_creator), assistant_login_linphone_account); } - (void)loadAssistantConfig:(NSString *)rcFilename { @@ -1138,6 +1139,18 @@ void assistant_activate_account(LinphoneAccountCreator *creator, LinphoneAccount } } +void assistant_login_linphone_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, + const char *resp) { + AssistantView *thiz = (__bridge AssistantView *)(linphone_account_creator_get_user_data(creator)); + thiz.waitView.hidden = YES; + if (status == LinphoneAccountCreatorStatusRequestOk) { + [thiz configureProxyConfig]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneAddressBookUpdate object:NULL]; + } else { + [thiz showErrorPopup:resp]; + } +} + void assistant_is_account_activated(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { AssistantView *thiz = (__bridge AssistantView *)(linphone_account_creator_get_user_data(creator)); @@ -1292,8 +1305,12 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun ((UITextField *)[self findView:ViewElement_SMSCode inView:_contentView ofType:UITextField.class]) .text.UTF8String); if (linphone_account_creator_get_password(account_creator) == NULL && - linphone_account_creator_get_ha1(account_creator) == NULL) { + linphone_account_creator_get_ha1(account_creator) == NULL) { + if ([_activationTitle.text isEqualToString:@"USE LINPHONE ACCOUNT"]) { + linphone_account_creator_login_linphone_account(account_creator); + } else { 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]); diff --git a/Classes/SettingsView.m b/Classes/SettingsView.m index 215388b1d..017f0a370 100644 --- a/Classes/SettingsView.m +++ b/Classes/SettingsView.m @@ -882,6 +882,7 @@ void update_hash_cbs(LinphoneAccountCreator *creator, LinphoneAccountCreatorStat completion:nil]; return; } + linphone_account_creator_set_algorithm(account_creator, ""); linphone_account_creator_set_username(account_creator, linphone_auth_info_get_username(ai)); if (linphone_auth_info_get_passwd(ai) && !(strcmp(linphone_auth_info_get_passwd(ai),"") == 0)) { linphone_account_creator_set_password(account_creator, linphone_auth_info_get_passwd(ai));