mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix IPAD go to chat view from ContactDetailView
This commit is contained in:
parent
6b8c96348d
commit
d680e7a2e4
2 changed files with 6 additions and 6 deletions
|
|
@ -98,12 +98,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
|
|||
while (iter) {
|
||||
// store last message in user data
|
||||
LinphoneChatRoom *chat_room = iter->data;
|
||||
// hide empty one-to-one chat room
|
||||
LinphoneChatRoomCapabilitiesMask capabilities = linphone_chat_room_get_capabilities(chat_room);
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
if (linphone_chat_room_get_history_size(chat_room) > 0 || !(capabilities & LinphoneChatRoomCapabilitiesOneToOne) || (IPAD && view.chatRoom == chat_room)) {
|
||||
sorted = bctbx_list_insert_sorted(sorted, chat_room, (bctbx_compare_func)sorted_history_comparison);
|
||||
}
|
||||
sorted = bctbx_list_insert_sorted(sorted, chat_room, (bctbx_compare_func)sorted_history_comparison);
|
||||
iter = iter->next;
|
||||
}
|
||||
return sorted;
|
||||
|
|
@ -120,6 +115,9 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
|
|||
if (idx != -1) {
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:idx inSection:0];
|
||||
[self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
|
||||
} else if ([LinphoneManager.instance lpConfigBoolForKey:@"create_chat" withDefault:FALSE]) {
|
||||
// if create chat, show the empty chat
|
||||
[LinphoneManager.instance lpConfigSetBool:FALSE forKey:@"create_chat"];
|
||||
} else if (![self selectFirstRow]) {
|
||||
ChatConversationCreateView *view = VIEW(ChatConversationCreateView);
|
||||
view.tableController.notFirstTime = FALSE;
|
||||
|
|
|
|||
|
|
@ -152,12 +152,14 @@
|
|||
|
||||
- (IBAction)onChatClick:(id)event {
|
||||
LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:_addressLabel.text];
|
||||
[LinphoneManager.instance lpConfigSetBool:TRUE forKey:@"create_chat"];
|
||||
[PhoneMainView.instance getOrCreateOneToOneChatRoom:addr waitView:_waitView isEncrypted:FALSE];
|
||||
linphone_address_unref(addr);
|
||||
}
|
||||
|
||||
- (IBAction)onEncrptedChatClick:(id)sender {
|
||||
LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:_addressLabel.text];
|
||||
[LinphoneManager.instance lpConfigSetBool:TRUE forKey:@"create_chat"];
|
||||
[PhoneMainView.instance getOrCreateOneToOneChatRoom:addr waitView:_waitView isEncrypted:TRUE];
|
||||
linphone_address_unref(addr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue