mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
fix crash of creating chatroom when no network
This commit is contained in:
parent
992dbb8415
commit
19acd2981b
5 changed files with 26 additions and 23 deletions
|
|
@ -200,18 +200,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (void)onLoginClick:(id)sender {
|
||||
if (!linphone_core_is_network_reachable(LC)) {
|
||||
UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Network Error", nil)
|
||||
message:NSLocalizedString(@"There is no network connection available, enable "
|
||||
@"WIFI or WWAN prior to configure an account",
|
||||
nil)
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {}];
|
||||
|
||||
[errView addAction:defaultAction];
|
||||
[self presentViewController:errView animated:YES completion:nil];
|
||||
[PhoneMainView.instance presentViewController:[LinphoneUtils networkErrorView] animated:YES completion:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2676,16 +2676,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
- (void)call:(const LinphoneAddress *)iaddr {
|
||||
// First verify that network is available, abort otherwise.
|
||||
if (!linphone_core_is_network_reachable(theLinphoneCore)) {
|
||||
UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Network Error", nil)
|
||||
message:NSLocalizedString(@"There is no network connection available, enable WIFI or WWAN prior to place a call", nil)
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {}];
|
||||
|
||||
[errView addAction:defaultAction];
|
||||
[PhoneMainView.instance presentViewController:errView animated:YES completion:nil];
|
||||
[PhoneMainView.instance presentViewController:[LinphoneUtils networkErrorView] animated:YES completion:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -878,7 +878,12 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
[self changeCurrentView:ChatsListView.compositeViewDescription];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!linphone_core_is_network_reachable(LC)) {
|
||||
[PhoneMainView.instance presentViewController:[LinphoneUtils networkErrorView] animated:YES completion:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
const LinphoneAddress *local = linphone_proxy_config_get_contact(linphone_core_get_default_proxy_config(LC));
|
||||
LinphoneChatRoom *room = linphone_core_find_one_to_one_chat_room_2(LC, local, remoteAddress, isEncrypted);
|
||||
if (!room) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
+ (NSString *)deviceModelIdentifier;
|
||||
|
||||
+ (LinphoneAddress *)normalizeSipOrPhoneAddress:(NSString *)addr;
|
||||
+ (UIAlertController *)networkErrorView;
|
||||
|
||||
typedef enum {
|
||||
LinphoneDateHistoryList,
|
||||
|
|
|
|||
|
|
@ -531,6 +531,23 @@
|
|||
return res;
|
||||
}
|
||||
|
||||
+ (UIAlertController *)networkErrorView {
|
||||
UIAlertController *errView =
|
||||
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Network Error", nil)
|
||||
message:NSLocalizedString(@"There is no network connection available, "
|
||||
@"enable WIFI or WWAN prior to place a call",
|
||||
nil)
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action){
|
||||
}];
|
||||
|
||||
[errView addAction:defaultAction];
|
||||
return errView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSNumber (HumanReadableSize)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue