mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-02 03:09:23 +00:00
Add a check to avoid going back to DialerView if we’ve been started through a push notification and are already in a chatroom at startup (and a bit of tab/line reformatting)
This commit is contained in:
parent
96787efe4c
commit
55027dbc82
1 changed files with 28 additions and 32 deletions
|
|
@ -473,38 +473,34 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
- (void)startUp {
|
||||
@try {
|
||||
LinphoneManager *lm = LinphoneManager.instance;
|
||||
LOGI(@"%s", linphone_global_state_to_string(
|
||||
linphone_core_get_global_state(LC)));
|
||||
if (linphone_core_get_global_state(LC) != LinphoneGlobalOn) {
|
||||
[self changeCurrentView:DialerView.compositeViewDescription];
|
||||
} else if ([LinphoneManager.instance
|
||||
lpConfigBoolForKey:
|
||||
@"enable_first_login_view_preference"] ==
|
||||
true) {
|
||||
[PhoneMainView.instance
|
||||
changeCurrentView:FirstLoginView
|
||||
.compositeViewDescription];
|
||||
} else {
|
||||
// always start to dialer when testing
|
||||
// Change to default view
|
||||
const MSList *accountList = linphone_core_get_account_list(LC);
|
||||
if (accountList != NULL ||
|
||||
([lm lpConfigBoolForKey:@"hide_assistant_preference"] ==
|
||||
true) ||
|
||||
lm.isTesting) {
|
||||
[self
|
||||
changeCurrentView:DialerView.compositeViewDescription];
|
||||
} else {
|
||||
AssistantView *view = VIEW(AssistantView);
|
||||
[PhoneMainView.instance
|
||||
changeCurrentView:view.compositeViewDescription];
|
||||
[view reset];
|
||||
}
|
||||
}
|
||||
[self updateApplicationBadgeNumber]; // Update Badge at startup
|
||||
} @catch (NSException *exception) {
|
||||
// we'll wait until the app transitions correctly
|
||||
}
|
||||
LOGI(@"%s", linphone_global_state_to_string(linphone_core_get_global_state(LC)));
|
||||
|
||||
// If we've been started by a remote push notification,
|
||||
// we'll already be on the corresponding chat conversation view, no need to go anywhere else
|
||||
if (![[self currentView].name isEqualToString:@"ChatConversationView"]) {
|
||||
|
||||
if (linphone_core_get_global_state(LC) != LinphoneGlobalOn) {
|
||||
[self changeCurrentView:DialerView.compositeViewDescription];
|
||||
} else if ([LinphoneManager.instance lpConfigBoolForKey:@"enable_first_login_view_preference"] == true) {
|
||||
[PhoneMainView.instance changeCurrentView:FirstLoginView.compositeViewDescription];
|
||||
} else {
|
||||
// always start to dialer when testing
|
||||
// Change to default view
|
||||
const MSList *accountList = linphone_core_get_account_list(LC);
|
||||
if (accountList != NULL || ([lm lpConfigBoolForKey:@"hide_assistant_preference"] == true) || lm.isTesting) {
|
||||
[self changeCurrentView:DialerView.compositeViewDescription];
|
||||
} else {
|
||||
AssistantView *view = VIEW(AssistantView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
[view reset];
|
||||
}
|
||||
}
|
||||
}
|
||||
[self updateApplicationBadgeNumber]; // Update Badge at startup
|
||||
|
||||
} @catch (NSException *exception) {
|
||||
// we'll wait until the app transitions correctly
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateApplicationBadgeNumber {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue