From 4ddbbeb22baae4e67893f92cbc667182b193859f Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 7 Dec 2015 14:15:51 +0100 Subject: [PATCH] Assistant: reset default account if assistant is aborted --- Classes/AssistantView.h | 1 + Classes/AssistantView.m | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Classes/AssistantView.h b/Classes/AssistantView.h index 6b819dbde..25226c189 100644 --- a/Classes/AssistantView.h +++ b/Classes/AssistantView.h @@ -29,6 +29,7 @@ UIView *nextView; NSMutableArray *historyViews; LinphoneProxyConfig *new_config; + LinphoneProxyConfig *previous_default_config; } @property(nonatomic, strong) IBOutlet TPKeyboardAvoidingScrollView *contentView; diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 68c2377aa..41c3f548d 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -99,17 +99,10 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] removeObserver:self]; -} -- (void)viewDidLoad { - [super viewDidLoad]; - if (LinphoneManager.runningOnIpad) { - [LinphoneUtils adjustFontSize:_welcomeView mult:2.22f]; - [LinphoneUtils adjustFontSize:_createAccountView mult:2.22f]; - [LinphoneUtils adjustFontSize:_linphoneLoginView mult:2.22f]; - [LinphoneUtils adjustFontSize:_loginView mult:2.22f]; - [LinphoneUtils adjustFontSize:_createAccountActivationView mult:2.22f]; - [LinphoneUtils adjustFontSize:_remoteProvisioningLoginView mult:2.22f]; + // if we quit assistant without creating a new proxy config, just restore the previous one + if (!linphone_core_get_default_proxy_config([LinphoneManager getLc])) { + linphone_core_set_default_proxy_config([LinphoneManager getLc], previous_default_config); } } @@ -154,6 +147,7 @@ static UICompositeViewDescription *compositeDescription = nil; [self resetLiblinphone]; // we will set the new default proxy config in the assistant + previous_default_config = linphone_core_get_default_proxy_config([LinphoneManager getLc]); linphone_core_set_default_proxy_config([LinphoneManager getLc], NULL); }