diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index 190d9e5a8..3c1a294a5 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -103,6 +103,15 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - Action Functions +-(void) startChatRoom { + //Push ChatRoom + ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); + if(controller != nil) { + [controller setRemoteAddress:[addressField text]]; + } + addressField.text = @""; + +} - (IBAction)onAddClick:(id)event { if ([[addressField text ]length] == 0) { // if no address is manually set, lauch address book [ContactSelection setSelectionMode:ContactSelectionModeMessage]; @@ -110,12 +119,7 @@ static UICompositeViewDescription *compositeDescription = nil; [ContactSelection setSipFilter:TRUE]; [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE]; } else { - //Push ChatRoom - ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); - if(controller != nil) { - [controller setRemoteAddress:[addressField text]]; - } - addressField.text = @""; + [self startChatRoom]; } } @@ -127,6 +131,8 @@ static UICompositeViewDescription *compositeDescription = nil; - (BOOL)textFieldShouldReturn:(UITextField *)textField { [addressField resignFirstResponder]; - return YES; + if ([[addressField text ]length]> 0) + [self startChatRoom]; + return YES; } @end diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index eb1032839..a963bb6c4 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -162,8 +162,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); { [self setString: linphone_core_get_stun_server(lc) forKey:@"stun_preference"]; [self - setInteger:lp_config_get_int(linphone_core_get_config(lc),"app","ice_preference" - , 0) forKey:@"ice_preference"]; + setBool:linphone_core_get_firewall_policy(lc)==LinphonePolicyUseIce forKey:@"ice_preference"]; } {