From 39ee715e472b3018279f664b50664f1caccad4f5 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 29 Sep 2014 13:56:34 +0200 Subject: [PATCH] Fix bug when a chatroom is created without a configured proxy --- Classes/ChatViewController.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index 61b3cdbba..aab106dbb 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -110,11 +110,22 @@ static UICompositeViewDescription *compositeDescription = nil; -(void) startChatRoom { //Push ChatRoom + LinphoneChatRoom* room = linphone_core_get_or_create_chat_room([LinphoneManager getLc], [addressField.text UTF8String]); + if( room != nil ){ ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); if(controller != nil) { LinphoneChatRoom* room = linphone_core_get_or_create_chat_room([LinphoneManager getLc], [addressField.text UTF8String]); [controller setChatRoom:room]; } + } else { + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid address", nil) + message:@"Please specify the entire SIP address for the chat" + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Cancel", nil) + otherButtonTitles:nil]; + [alert show]; + [alert release]; + } addressField.text = @""; }