diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index 374836d2f..aaa9cd5e9 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -84,8 +84,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; - LinphoneChatRoom *room = linphone_core_get_chat_room_from_uri( - LC, ((NSString *)[_contacts.allKeys objectAtIndex:indexPath.row]).UTF8String); + NSString *uri; + LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:[_contacts.allKeys objectAtIndex:indexPath.row]]; + if (addr) { + uri = [NSString stringWithUTF8String:linphone_address_as_string(addr)]; + } else { + uri = [_contacts.allKeys objectAtIndex:indexPath.row]; + } + LinphoneChatRoom *room = linphone_core_get_chat_room_from_uri(LC, uri.UTF8String); if (!room) { [PhoneMainView.instance popCurrentView]; UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Invalid address", nil)