From 1ee3a6f0d46a05f1e57a44fc9f154e4545e17741 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 27 Apr 2018 10:32:55 +0200 Subject: [PATCH 1/9] update chat room view when all info received --- Classes/ChatConversationView.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 91f811ff3..6cac282fa 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -163,6 +163,7 @@ static UICompositeViewDescription *compositeDescription = nil; linphone_chat_room_cbs_set_chat_message_received(_chatRoomCbs, on_chat_room_chat_message_received); linphone_chat_room_cbs_set_chat_message_sent(_chatRoomCbs, on_chat_room_chat_message_sent); linphone_chat_room_cbs_set_is_composing_received(_chatRoomCbs, on_chat_room_is_composing_received); + linphone_chat_room_cbs_set_all_information_received(_chatRoomCbs, on_chat_room_all_information_received); linphone_chat_room_cbs_set_user_data(_chatRoomCbs, (__bridge void*)self); linphone_chat_room_add_callbacks(_chatRoom, _chatRoomCbs); } @@ -777,4 +778,9 @@ void on_chat_room_is_composing_received(LinphoneChatRoom *cr, const LinphoneAddr [view setComposingVisible:composing withDelay:0.3]; } +void on_chat_room_all_information_received(LinphoneChatRoom *cr) { + ChatConversationView *view = (__bridge ChatConversationView *)linphone_chat_room_cbs_get_user_data(linphone_chat_room_get_current_callbacks(cr)); + [view configureForRoom:false]; +} + @end From 718e698ff248d0dec5e1087e7051014fe81dc795 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 27 Apr 2018 10:39:03 +0200 Subject: [PATCH 2/9] use prefer_basic_chat_room in misc section to create only basic one-to-one --- Classes/PhoneMainView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index b1c789c4a..282bcf085 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -878,7 +878,7 @@ static RootViewManager *rootViewManagerInstance = nil; - (void)createChatRoomWithSubject:(const char *)subject addresses:(bctbx_list_t *)addresses andWaitView:(UIView *)waitView { if (!linphone_proxy_config_get_conference_factory_uri(linphone_core_get_default_proxy_config(LC)) - || ([[LinphoneManager instance] lpConfigBoolForKey:@"prefer_basic_chat_room" withDefault:FALSE] && bctbx_list_size(addresses) == 1)) { + || ([[LinphoneManager instance] lpConfigBoolForKey:@"prefer_basic_chat_room" inSection:@"misc"] && bctbx_list_size(addresses) == 1)) { // If there's no factory uri, create a basic chat room if (bctbx_list_size(addresses) != 1) { // Display Error: unsuported group chat From c3adcff0f6d89402db63c171f026582e01c87888 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 27 Apr 2018 14:34:35 +0200 Subject: [PATCH 3/9] update submodules [Switch submodule branch] --- submodules/bctoolbox | 2 +- submodules/belcard | 2 +- submodules/belle-sip | 2 +- submodules/linphone | 2 +- submodules/mediastreamer2 | 2 +- submodules/ortp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/submodules/bctoolbox b/submodules/bctoolbox index e34db6796..7df8b5ca0 160000 --- a/submodules/bctoolbox +++ b/submodules/bctoolbox @@ -1 +1 @@ -Subproject commit e34db6796ade971615d4b572bda87d9f699ea497 +Subproject commit 7df8b5ca085010ec35103414ed9582412aaff97d diff --git a/submodules/belcard b/submodules/belcard index b9e1951be..7376c8ba9 160000 --- a/submodules/belcard +++ b/submodules/belcard @@ -1 +1 @@ -Subproject commit b9e1951be4575c62e326d761a7f7c79c5cce9cb9 +Subproject commit 7376c8ba975617c8b2a7232c3acc428513a4ae8f diff --git a/submodules/belle-sip b/submodules/belle-sip index 2d4085354..cbb4ab4c2 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit 2d4085354443598d59d43168e16e47e4d34e0ca3 +Subproject commit cbb4ab4c2a58e4fa1954043f6b17266e1685c887 diff --git a/submodules/linphone b/submodules/linphone index 45bbb54ed..6157e3a92 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 45bbb54eda3d9c9abf9d9029f44ee17e926ed706 +Subproject commit 6157e3a92a44ee053452668bbb38636d4e98ebaa diff --git a/submodules/mediastreamer2 b/submodules/mediastreamer2 index f49b3d5ea..ad4cdb240 160000 --- a/submodules/mediastreamer2 +++ b/submodules/mediastreamer2 @@ -1 +1 @@ -Subproject commit f49b3d5ea3ab56b4b021a760a58f44015b3c5765 +Subproject commit ad4cdb240e553654f87438fb4519754e90d1773d diff --git a/submodules/ortp b/submodules/ortp index 8fff73b5b..1fcd6fd15 160000 --- a/submodules/ortp +++ b/submodules/ortp @@ -1 +1 @@ -Subproject commit 8fff73b5b56f1cbf6fcca10068cc0f401d024420 +Subproject commit 1fcd6fd1558f26255ae9dac687191ddf988bfd5b From 1cd0bb569fd009ddf4fabd6b850dca9ca948a794 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 27 Apr 2018 14:37:37 +0200 Subject: [PATCH 4/9] repair file transfer --- Classes/Utils/FileTransferDelegate.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Classes/Utils/FileTransferDelegate.m b/Classes/Utils/FileTransferDelegate.m index 87470abd7..c37782c24 100644 --- a/Classes/Utils/FileTransferDelegate.m +++ b/Classes/Utils/FileTransferDelegate.m @@ -38,12 +38,12 @@ static void linphone_iphone_file_transfer_recv(LinphoneChatMessage *message, con size_t size = linphone_buffer_get_size(buffer); if (!thiz.data) { - thiz.data = [[NSMutableData alloc] initWithCapacity:linphone_content_get_size(content)]; + thiz.data = [[NSMutableData alloc] initWithCapacity:linphone_content_get_file_size(content)]; } if (size == 0) { LOGI(@"Transfer of %s (%d bytes): download finished", linphone_content_get_name(content), size); - assert([thiz.data length] == linphone_content_get_size(content)); + assert([thiz.data length] == linphone_content_get_file_size(content)); // we're finished, save the image and update the message UIImage *image = [UIImage imageWithData:thiz.data]; @@ -63,6 +63,7 @@ static void linphone_iphone_file_transfer_recv(LinphoneChatMessage *message, con [errView addAction:defaultAction]; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; + [thiz stopAndDestroy]; return; } @@ -97,7 +98,6 @@ static void linphone_iphone_file_transfer_recv(LinphoneChatMessage *message, con forKey:@"localimage" inMessage:message]; } - thiz.message = NULL; [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneFileTransferRecvUpdate object:thiz @@ -114,14 +114,14 @@ static void linphone_iphone_file_transfer_recv(LinphoneChatMessage *message, con }]; } else { LOGD(@"Transfer of %s (%d bytes): already %ld sent, adding %ld", linphone_content_get_name(content), - linphone_content_get_size(content), [thiz.data length], size); + linphone_content_get_file_size(content), [thiz.data length], size); [thiz.data appendBytes:linphone_buffer_get_string_content(buffer) length:size]; [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneFileTransferRecvUpdate object:thiz userInfo:@{ @"state" : @(linphone_chat_message_get_state(message)), - @"progress" : @([thiz.data length] * 1.f / linphone_content_get_size(content)), + @"progress" : @([thiz.data length] * 1.f / linphone_content_get_file_size(content)), }]; } } From 9201fe28da3941db705c834cefdb603c1780378c Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 27 Apr 2018 15:09:06 +0200 Subject: [PATCH 5/9] update linphoen & add const --- Classes/LinphoneUI/StatusBarView.m | 2 +- submodules/linphone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneUI/StatusBarView.m b/Classes/LinphoneUI/StatusBarView.m index bdccd0896..78a76e600 100644 --- a/Classes/LinphoneUI/StatusBarView.m +++ b/Classes/LinphoneUI/StatusBarView.m @@ -137,7 +137,7 @@ (linphone_content_get_buffer(content) == NULL)) { return; } - uint8_t *bodyTmp = linphone_content_get_buffer(content); + const uint8_t *bodyTmp = linphone_content_get_buffer(content); const char *body = (const char *)bodyTmp; if ((body = strstr(body, "voice-message: ")) == NULL) { LOGW(@"Received new NOTIFY from voice mail but could not find 'voice-message' in BODY. Ignoring it."); diff --git a/submodules/linphone b/submodules/linphone index 6157e3a92..a06c0cf3d 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 6157e3a92a44ee053452668bbb38636d4e98ebaa +Subproject commit a06c0cf3d796842007905a22fc9a198438faeb7c From 3e2eed4ee7153ef772ab48e278572b2cf4bfa80b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 27 Apr 2018 15:53:53 +0200 Subject: [PATCH 6/9] factorize and improve how to go to a chat room --- Classes/ChatsListTableView.m | 13 +------------ Classes/LinphoneAppDelegate.m | 4 +--- Classes/PhoneMainView.h | 1 + Classes/PhoneMainView.m | 13 ++++++++++--- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/Classes/ChatsListTableView.m b/Classes/ChatsListTableView.m index ab767729e..5b76ae1ee 100644 --- a/Classes/ChatsListTableView.m +++ b/Classes/ChatsListTableView.m @@ -162,24 +162,13 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo return; LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(_data, (int)[indexPath row]); - ChatConversationView *view = VIEW(ChatConversationView); - LinphoneChatRoom *oldRoom = view.chatRoom; - if (oldRoom) { - LinphoneChatRoomCbs *oldCbs = linphone_chat_room_get_current_callbacks(oldRoom); - if (oldCbs && view.chatRoomCbs && oldCbs == view.chatRoomCbs) { - linphone_chat_room_remove_callbacks(oldRoom, view.chatRoomCbs); - view.chatRoomCbs = NULL; - } - } + [PhoneMainView.instance goToChatRoom:chatRoom]; - view.chatRoom = chatRoom; // on iPad, force unread bubble to disappear by reloading the cell if (IPAD) { UIChatCell *cell = (UIChatCell *)[tableView cellForRowAtIndexPath:indexPath]; [cell updateUnreadBadge]; - [view configureForRoom:false]; } - [PhoneMainView.instance changeCurrentView:view.compositeViewDescription]; } void deletion_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) { diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index b9c0e2815..c2f2db77e 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -667,9 +667,7 @@ didInvalidatePushTokenForType:(NSString *)type { LinphoneAddress *local = linphone_address_new(local_address.UTF8String); LinphoneChatRoom *room = linphone_core_find_chat_room(LC, peer, local); if (room) { - ChatConversationView *view = VIEW(ChatConversationView); - view.chatRoom = room; - [PhoneMainView.instance changeCurrentView:view.compositeViewDescription]; + [PhoneMainView.instance goToChatRoom:room]; return; } [PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription]; diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 3d3f39c3b..d9f1e0d66 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -110,6 +110,7 @@ - (void)updateApplicationBadgeNumber; - (void)getOrCreateOneToOneChatRoom:(const LinphoneAddress *)remoteAddress waitView:(UIView *)waitView; - (void)createChatRoomWithSubject:(const char *)subject addresses:(bctbx_list_t *)addresses andWaitView:(UIView *)waitView; +- (void)goToChatRoom:(LinphoneChatRoom *)cr; + (PhoneMainView*) instance; - (BOOL)isIphoneXDevice; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 282bcf085..761eeab14 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -871,9 +871,8 @@ static RootViewManager *rootViewManagerInstance = nil; bctbx_list_free(addresses); return; } - ChatConversationView *view = VIEW(ChatConversationView); - view.chatRoom = room; - [self changeCurrentView:view.compositeViewDescription]; + + [self goToChatRoom:room]; } - (void)createChatRoomWithSubject:(const char *)subject addresses:(bctbx_list_t *)addresses andWaitView:(UIView *)waitView { @@ -918,7 +917,15 @@ static RootViewManager *rootViewManagerInstance = nil; _waitView.hidden = YES; _waitView = NULL; ChatConversationView *view = VIEW(ChatConversationView); + if (view.chatRoom && view.chatRoomCbs) + linphone_chat_room_remove_callbacks(view.chatRoom, view.chatRoomCbs); + + if (PhoneMainView.instance.currentView == view.compositeViewDescription) + [PhoneMainView.instance popCurrentView]; + + view.chatRoomCbs = NULL; view.chatRoom = cr; + self.currentRoom = view.chatRoom; [PhoneMainView.instance changeCurrentView:view.compositeViewDescription]; } From 5321ec6191dc4b970c30003007d402b730cb98a0 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 27 Apr 2018 17:04:43 +0200 Subject: [PATCH 7/9] deactivate imdn aggregation --- Resources/linphonerc-factory | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 99364ce06..d74cdcdbc 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -44,6 +44,7 @@ tcp_tls_keepalive=30000 #by default it is set to 30 by liblinphone history_max_size=-1 enable_basic_to_client_group_chat_room_migration=0 +aggregate_imdn=0 [sound] dtmf_player_amp=0.007 From 6aa18fd9c3ac29f96b826076cd7fa640e55a789d Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 30 Apr 2018 09:53:49 +0200 Subject: [PATCH 8/9] update linphoen --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index a06c0cf3d..0041defd0 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit a06c0cf3d796842007905a22fc9a198438faeb7c +Subproject commit 0041defd0085c928e6e9dd659f1eae015254cb04 From 6257a6392102a91885eded020e2bf1fdf4764b6f Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 30 Apr 2018 09:59:56 +0200 Subject: [PATCH 9/9] beta 3.99.4 --- linphone-Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linphone-Info.plist b/linphone-Info.plist index 57208645b..160233698 100644 --- a/linphone-Info.plist +++ b/linphone-Info.plist @@ -24,7 +24,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 3.99.3 + 3.99.4 CFBundleURLTypes