From 4f4adc81dbb88233b8c102a34792bc96e0c249bd Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 20 Nov 2015 14:35:08 +0100 Subject: [PATCH] Chat: optimize conversation loading time and replace deprecated functions --- Classes/Base.lproj/AssistantViewScreens.xib | 2 +- Classes/CallConferenceTableView.m | 4 +- Classes/CallPausedTableView.m | 3 +- Classes/CallView.m | 2 +- Classes/ChatConversationCreateTableView.m | 2 +- Classes/ChatConversationTableView.m | 2 +- Classes/ChatsListTableView.m | 2 +- Classes/ContactDetailsTableView.m | 2 +- Classes/ContactDetailsView.m | 2 +- Classes/DialerView.m | 4 +- Classes/LinphoneCoreSettingsStore.m | 5 +- Classes/LinphoneManager.m | 13 ++-- Classes/LinphoneUI/UICallConferenceCell.m | 2 +- Classes/LinphoneUI/UIChatBubbleTextCell.h | 1 + Classes/LinphoneUI/UIChatBubbleTextCell.m | 68 +++++++++------------ Classes/LinphoneUI/UIContactDetailsCell.m | 6 +- Classes/LinphoneUI/UIDigitButton.m | 2 +- Classes/LinphoneUI/UIHangUpButton.m | 2 +- Classes/LinphoneUI/UIMicroButton.m | 6 +- Classes/LinphoneUI/UIPauseButton.m | 2 +- Classes/LinphoneUI/UIVideoButton.m | 6 +- Classes/SettingsView.m | 2 +- Classes/Utils/FastAddressBook.m | 2 +- Classes/Utils/FileTransferDelegate.m | 2 +- TestsUI/ChatTester.m | 4 +- TestsUI/LinphoneTestCase.m | 2 +- submodules/cmake-builder | 2 +- submodules/linphone | 2 +- 28 files changed, 73 insertions(+), 81 deletions(-) diff --git a/Classes/Base.lproj/AssistantViewScreens.xib b/Classes/Base.lproj/AssistantViewScreens.xib index 762518828..f89624285 100644 --- a/Classes/Base.lproj/AssistantViewScreens.xib +++ b/Classes/Base.lproj/AssistantViewScreens.xib @@ -393,7 +393,7 @@ - + diff --git a/Classes/CallConferenceTableView.m b/Classes/CallConferenceTableView.m index 8d1a87c0b..38441d639 100644 --- a/Classes/CallConferenceTableView.m +++ b/Classes/CallConferenceTableView.m @@ -51,7 +51,7 @@ const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]); int i = -1; while (calls) { - if (linphone_call_is_in_conference(calls->data)) { + if (linphone_call_params_get_local_conference_mode(calls->data)) { i++; if (i == row) break; @@ -77,7 +77,7 @@ const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]); int count = 0; while (calls) { - if (linphone_call_is_in_conference(calls->data)) { + if (linphone_call_params_get_local_conference_mode(calls->data)) { count++; } calls = calls->next; diff --git a/Classes/CallPausedTableView.m b/Classes/CallPausedTableView.m index 864bb7412..2f62d8e41 100644 --- a/Classes/CallPausedTableView.m +++ b/Classes/CallPausedTableView.m @@ -89,7 +89,8 @@ if (linphone_call_get_state(call) == LinphoneCallPaused) { count++; } - if (linphone_call_is_in_conference(call) && !linphone_core_is_in_conference([LinphoneManager getLc])) { + if (linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call)) && + !linphone_core_is_in_conference([LinphoneManager getLc])) { conference_in_pause = 1; } calls = calls->next; diff --git a/Classes/CallView.m b/Classes/CallView.m index b6338b870..4e07c2b65 100644 --- a/Classes/CallView.m +++ b/Classes/CallView.m @@ -666,7 +666,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) { const LinphoneCallParams *remote = linphone_call_get_remote_params(call); /* remote wants to add video */ - if (linphone_core_video_enabled(lc) && !linphone_call_params_video_enabled(current) && + if (linphone_core_video_display_enabled(lc) && !linphone_call_params_video_enabled(current) && linphone_call_params_video_enabled(remote) && !linphone_core_get_video_policy(lc)->automatically_accept) { linphone_core_defer_call_update(lc, call); diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index 9dd2ae315..a6de82ed7 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -44,7 +44,7 @@ }]; // also add current entry, if not listed NSString *nsuri = filter.lowercaseString; - LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], nsuri.UTF8String); + LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, nsuri.UTF8String); if (addr) { char *uri = linphone_address_as_string(addr); nsuri = [NSString stringWithUTF8String:uri]; diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index 1224ec6b8..c8e4812be 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -209,7 +209,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { LinphoneChatMessage *chat = ms_list_nth_data(messageList, (int)[indexPath row]); - return [UIChatBubbleTextCell ViewSizeForMessage:chat withWidth:self.view.frame.size.width].height; + return [UIChatBubbleTextCell ViewHeightForMessage:chat withWidth:self.view.frame.size.width].height; } diff --git a/Classes/ChatsListTableView.m b/Classes/ChatsListTableView.m index 1d07656e8..31050eada 100644 --- a/Classes/ChatsListTableView.m +++ b/Classes/ChatsListTableView.m @@ -164,7 +164,7 @@ static void chatTable_free_chatrooms(void *data) { } [ftdToDelete cancel]; - linphone_core_delete_chat_room(linphone_chat_room_get_lc(chatRoom), chatRoom); + linphone_core_delete_chat_room(linphone_chat_room_get_core(chatRoom), chatRoom); data = ms_list_remove(data, chatRoom); // will force a call to [self loadData] diff --git a/Classes/ContactDetailsTableView.m b/Classes/ContactDetailsTableView.m index abbd1f9a8..9bd1e9a9e 100644 --- a/Classes/ContactDetailsTableView.m +++ b/Classes/ContactDetailsTableView.m @@ -271,7 +271,7 @@ if ([lDict objectForKey:(__bridge NSString *)kABPersonInstantMessageServiceKey] == nil) { /*too bad probably a gtalk number, storing uri*/ NSString *username = [lDict objectForKey:(NSString *)kABPersonInstantMessageUsernameKey]; - LinphoneAddress *address = linphone_core_interpret_url([LinphoneManager getLc], [username UTF8String]); + LinphoneAddress *address = linphone_proxy_config_normalize_sip_uri(NULL, [username UTF8String]); if (address) { char *uri = linphone_address_as_string_uri_only(address); NSDictionary *dict2 = @{ diff --git a/Classes/ContactDetailsView.m b/Classes/ContactDetailsView.m index def1ee196..eb9f284da 100644 --- a/Classes/ContactDetailsView.m +++ b/Classes/ContactDetailsView.m @@ -124,7 +124,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info } - (void)addCurrentContactContactField:(NSString *)address { - LinphoneAddress *linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], address.UTF8String); + LinphoneAddress *linphoneAddress = linphone_proxy_config_normalize_sip_uri(NULL, address.UTF8String); NSString *username = linphoneAddress ? [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)] : address; diff --git a/Classes/DialerView.m b/Classes/DialerView.m index fcbaa3a68..3cb103d6a 100644 --- a/Classes/DialerView.m +++ b/Classes/DialerView.m @@ -119,7 +119,7 @@ static UICompositeViewDescription *compositeDescription = nil; [self callUpdate:call state:state]; if (LinphoneManager.runningOnIpad) { - BOOL videoEnabled = linphone_core_video_enabled(lc); + BOOL videoEnabled = linphone_core_video_display_enabled(lc); BOOL previewPref = [mgr lpConfigBoolForKey:@"preview_preference"]; if (videoEnabled && previewPref) { @@ -222,7 +222,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)coreUpdateEvent:(NSNotification *)notif { if (LinphoneManager.runningOnIpad) { LinphoneCore *lc = [LinphoneManager getLc]; - if (linphone_core_video_enabled(lc) && linphone_core_video_preview_enabled(lc)) { + if (linphone_core_video_display_enabled(lc) && linphone_core_video_preview_enabled(lc)) { linphone_core_set_native_preview_window_id(lc, (__bridge void *)(videoPreview)); [backgroundView setHidden:FALSE]; [videoCameraSwitch setHidden:FALSE]; diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index d2a741def..22a5f84f4 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -195,7 +195,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); forKey:key]; } - [self setBool:linphone_core_video_enabled(lc) forKey:@"enable_video_preference"]; + [self setBool:linphone_core_video_display_enabled(lc) forKey:@"enable_video_preference"]; [self setBool:[LinphoneManager.instance lpConfigBoolForKey:@"auto_answer"] forKey:@"enable_auto_answer_preference"]; [self setBool:[lm lpConfigBoolForKey:@"advanced_account_preference"] forKey:@"advanced_account_preference"]; @@ -588,7 +588,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self synchronizeAccounts]; bool enableVideo = [self boolForKey:@"enable_video_preference"]; - linphone_core_enable_video(lc, enableVideo, enableVideo); + linphone_core_enable_video_capture(lc, enableVideo); + linphone_core_enable_video_display(lc, enableVideo); bool enableAutoAnswer = [self boolForKey:@"enable_auto_answer_preference"]; [LinphoneManager.instance lpConfigSetBool:enableAutoAnswer forKey:@"auto_answer"]; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index b28c6592f..832330892 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1282,17 +1282,11 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach #pragma mark - VTable static LinphoneCoreVTable linphonec_vtable = { - .show = NULL, .call_state_changed = (LinphoneCoreCallStateChangedCb)linphone_iphone_call_state, .registration_state_changed = linphone_iphone_registration_state, .notify_presence_received = NULL, .new_subscription_requested = NULL, .auth_info_requested = linphone_iphone_popup_password_request, - .display_status = linphone_iphone_display_status, - .display_message = linphone_iphone_log_user_info, - .display_warning = linphone_iphone_log_user_warning, - .display_url = NULL, - .text_received = NULL, .message_received = linphone_iphone_message_received, .dtmf_received = NULL, .transfer_state_changed = linphone_iphone_transfer_state_changed, @@ -1383,7 +1377,8 @@ static LinphoneCoreVTable linphonec_vtable = { linphone_core_enable_payload_type(theLinphoneCore, pt, FALSE); LOGW(@"SILK/24000 and video disabled on old iPhone 3G"); } - linphone_core_enable_video(theLinphoneCore, FALSE, FALSE); + linphone_core_enable_video_display(theLinphoneCore, FALSE); + linphone_core_enable_video_capture(theLinphoneCore, FALSE); } LOGI(@"Linphone [%s] started on [%s]", linphone_core_get_version(), [[UIDevice currentDevice].model UTF8String]); @@ -1715,7 +1710,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { linphone_core_start_dtmf_stream(theLinphoneCore); /*start the video preview in case we are in the main view*/ - if (LinphoneManager.runningOnIpad && linphone_core_video_enabled(theLinphoneCore) && + if (LinphoneManager.runningOnIpad && linphone_core_video_display_enabled(theLinphoneCore) && [self lpConfigBoolForKey:@"preview_preference"]) { linphone_core_enable_video_preview(theLinphoneCore, TRUE); } @@ -1931,7 +1926,7 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1 // Continue by checking that the provided address is a valid SIP address, abort otherwise. if ([address length] == 0) { // no address provided... nothing to do - } else if ((addr = linphone_core_interpret_url(theLinphoneCore, address.UTF8String)) == NULL) { + } else if ((addr = linphone_proxy_config_normalize_sip_uri(NULL, address.UTF8String)) == NULL) { UIAlertView *error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid SIP address", nil) message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a " diff --git a/Classes/LinphoneUI/UICallConferenceCell.m b/Classes/LinphoneUI/UICallConferenceCell.m index 0caf2588d..6470df9cf 100644 --- a/Classes/LinphoneUI/UICallConferenceCell.m +++ b/Classes/LinphoneUI/UICallConferenceCell.m @@ -29,7 +29,7 @@ - (void)setCall:(LinphoneCall *)call { _call = call; - if (!call || !linphone_call_is_in_conference(call)) { + if (!call || !linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call))) { LOGF(@"Invalid call: either NULL or not in conference."); return; } diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.h b/Classes/LinphoneUI/UIChatBubbleTextCell.h index f62aa6764..5c300c628 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.h +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.h @@ -45,6 +45,7 @@ - (IBAction)onResendClick:(id)event; - (void)update; ++ (CGSize)ViewHeightForMessage:(LinphoneChatMessage *)chat withWidth:(int)width; + (NSString *)TextMessageForChat:(LinphoneChatMessage *)message; + (CGSize)computeBoundingBox:(NSString *)text size:(CGSize)size font:(UIFont *)font; diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.m b/Classes/LinphoneUI/UIChatBubbleTextCell.m index 31d7dca08..1f86c52d0 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.m +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.m @@ -223,7 +223,8 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 7) { return [text boundingRectWithSize:size - options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) + options:(NSStringDrawingUsesLineFragmentOrigin | + NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesFontLeading) attributes:@{ NSFontAttributeName : font } @@ -241,54 +242,45 @@ static const CGFloat CELL_MESSAGE_Y_MARGIN = 32; static const CGFloat CELL_IMAGE_HEIGHT = 100.0f; static const CGFloat CELL_IMAGE_WIDTH = 100.0f; -+ (CGSize)ViewSizeForMessage:(LinphoneChatMessage *)chat withWidth:(int)width { - static UIFont *messageFont = nil; - static UIFont *dateFont = nil; - static CGSize dateViewSize; - CGSize messageSize; - const char *url = linphone_chat_message_get_external_body_url(chat); ++ (CGSize)ViewHeightForMessage:(LinphoneChatMessage *)chat withWidth:(int)width { NSString *messageText = [UIChatBubbleTextCell TextMessageForChat:chat]; - UITableView *tableView = VIEW(ChatConversationView).tableController.tableView; - if (tableView.isEditing) - width -= 40; /*checkbox */ - + static UIFont *messageFont = nil; if (!messageFont) { UIChatBubbleTextCell *cell = [[UIChatBubbleTextCell alloc] initWithIdentifier:NSStringFromClass(UIChatBubbleTextCell.class)]; messageFont = cell.messageText.font; + } + if (tableView.isEditing) + width -= 40; /*checkbox */ + CGSize size; + const char *url = linphone_chat_message_get_external_body_url(chat); + if (url == nil && linphone_chat_message_get_file_transfer_information(chat) == NULL) { + size = [self computeBoundingBox:messageText + size:CGSizeMake(width - CELL_MESSAGE_X_MARGIN, CGFLOAT_MAX) + font:messageFont]; + } else { + NSString *localImage = [LinphoneManager getMessageAppDataForKey:@"localimage" inMessage:chat]; + size = (localImage != nil) ? CGSizeMake(CELL_IMAGE_WIDTH, CELL_IMAGE_HEIGHT) : CGSizeMake(50, 50); + } + size.width = MAX(size.width + CELL_MESSAGE_X_MARGIN, CELL_MIN_WIDTH); + size.height = MAX(size.height + CELL_MESSAGE_Y_MARGIN, CELL_MIN_HEIGHT); + return size; +} ++ (CGSize)ViewSizeForMessage:(LinphoneChatMessage *)chat withWidth:(int)width { + static UIFont *dateFont = nil; + static CGSize dateViewSize; + + if (!dateFont) { + UIChatBubbleTextCell *cell = + [[UIChatBubbleTextCell alloc] initWithIdentifier:NSStringFromClass(UIChatBubbleTextCell.class)]; dateFont = cell.contactDateLabel.font; dateViewSize = cell.contactDateLabel.frame.size; } - if (url == nil && linphone_chat_message_get_file_transfer_information(chat) == NULL) { -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 - if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 7) { - messageSize = [messageText boundingRectWithSize:CGSizeMake(width - CELL_MESSAGE_X_MARGIN, CGFLOAT_MAX) - options:(NSStringDrawingUsesLineFragmentOrigin | - NSStringDrawingTruncatesLastVisibleLine | - NSStringDrawingUsesFontLeading) - attributes:@{ - NSFontAttributeName : messageFont - } - context:nil] - .size; - } else -#endif - { - messageSize = [messageText sizeWithFont:messageFont - constrainedToSize:CGSizeMake(width - CELL_MESSAGE_X_MARGIN, 10000.0f) - lineBreakMode:NSLineBreakByTruncatingTail]; - } - } else { - NSString *localImage = [LinphoneManager getMessageAppDataForKey:@"localimage" inMessage:chat]; - messageSize = (localImage != nil) ? CGSizeMake(CELL_IMAGE_WIDTH, CELL_IMAGE_HEIGHT) : CGSizeMake(50, 50); - } + CGSize messageSize = [self ViewHeightForMessage:chat withWidth:width]; CGSize dateSize = [self computeBoundingBox:[self ContactDateForChat:chat] size:dateViewSize font:dateFont]; - messageSize.width = MAX(messageSize.width, dateSize.width); - - messageSize.width = MAX(messageSize.width + CELL_MESSAGE_X_MARGIN, CELL_MIN_WIDTH); - messageSize.height = MAX(messageSize.height + CELL_MESSAGE_Y_MARGIN, CELL_MIN_HEIGHT); + messageSize.width = MAX(MAX(messageSize.width, dateSize.width), CELL_MIN_WIDTH); return messageSize; } diff --git a/Classes/LinphoneUI/UIContactDetailsCell.m b/Classes/LinphoneUI/UIContactDetailsCell.m index 2d301fdbd..4aca6345c 100644 --- a/Classes/LinphoneUI/UIContactDetailsCell.m +++ b/Classes/LinphoneUI/UIContactDetailsCell.m @@ -43,7 +43,7 @@ - (void)setAddress:(NSString *)address { _addressLabel.text = _editTextfield.text = address; - LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String); + LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, _addressLabel.text.UTF8String); _chatButton.enabled = _callButton.enabled = (addr != NULL); _chatButton.accessibilityLabel = @@ -75,7 +75,7 @@ } - (IBAction)onCallClick:(id)event { - LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String); + LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, _addressLabel.text.UTF8String); if (addr == NULL) return; char *lAddress = linphone_address_as_string_uri_only(addr); @@ -89,7 +89,7 @@ } - (IBAction)onChatClick:(id)event { - LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String); + LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, _addressLabel.text.UTF8String); if (addr == NULL) return; [PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription]; diff --git a/Classes/LinphoneUI/UIDigitButton.m b/Classes/LinphoneUI/UIDigitButton.m index 5ae00a379..700b15faa 100644 --- a/Classes/LinphoneUI/UIDigitButton.m +++ b/Classes/LinphoneUI/UIDigitButton.m @@ -69,7 +69,7 @@ [addressField setText:newAddress]; linphone_core_play_dtmf([LinphoneManager getLc], digit, -1); } else { - linphone_core_send_dtmf([LinphoneManager getLc], digit); + linphone_call_send_dtmf(linphone_core_get_current_call([LinphoneManager getLc]), digit); linphone_core_play_dtmf([LinphoneManager getLc], digit, 100); } } diff --git a/Classes/LinphoneUI/UIHangUpButton.m b/Classes/LinphoneUI/UIHangUpButton.m index 78d336e94..47e4b2c3b 100644 --- a/Classes/LinphoneUI/UIHangUpButton.m +++ b/Classes/LinphoneUI/UIHangUpButton.m @@ -27,7 +27,7 @@ + (bool)isInConference:(LinphoneCall *)call { if (!call) return false; - return linphone_call_is_in_conference(call); + return linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call)); } + (int)callCount:(LinphoneCore *)lc { diff --git a/Classes/LinphoneUI/UIMicroButton.m b/Classes/LinphoneUI/UIMicroButton.m index 95964760c..58d5c3b20 100644 --- a/Classes/LinphoneUI/UIMicroButton.m +++ b/Classes/LinphoneUI/UIMicroButton.m @@ -24,15 +24,15 @@ @implementation UIMicroButton - (void)onOn { - linphone_core_mute_mic([LinphoneManager getLc], false); + linphone_core_enable_mic([LinphoneManager getLc], false); } - (void)onOff { - linphone_core_mute_mic([LinphoneManager getLc], true); + linphone_core_enable_mic([LinphoneManager getLc], true); } - (bool)onUpdate { - return linphone_core_is_mic_muted([LinphoneManager getLc]); + return linphone_core_mic_enabled([LinphoneManager getLc]); } @end diff --git a/Classes/LinphoneUI/UIPauseButton.m b/Classes/LinphoneUI/UIPauseButton.m index 6f828271f..981bfb102 100644 --- a/Classes/LinphoneUI/UIPauseButton.m +++ b/Classes/LinphoneUI/UIPauseButton.m @@ -58,7 +58,7 @@ + (bool)isInConference:(LinphoneCall *)call { if (!call) return false; - return linphone_call_is_in_conference(call); + return linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call)); } + (int)notInConferenceCallCount:(LinphoneCore *)lc { diff --git a/Classes/LinphoneUI/UIVideoButton.m b/Classes/LinphoneUI/UIVideoButton.m index c5a9ae6b1..9909fa9ce 100644 --- a/Classes/LinphoneUI/UIVideoButton.m +++ b/Classes/LinphoneUI/UIVideoButton.m @@ -58,7 +58,7 @@ - (void)onOn { LinphoneCore *lc = [LinphoneManager getLc]; - if (!linphone_core_video_enabled(lc)) + if (!linphone_core_video_display_enabled(lc)) return; [self setEnabled:FALSE]; @@ -81,7 +81,7 @@ - (void)onOff { LinphoneCore *lc = [LinphoneManager getLc]; - if (!linphone_core_video_enabled(lc)) + if (!linphone_core_video_display_enabled(lc)) return; [self setEnabled:FALSE]; @@ -103,7 +103,7 @@ LinphoneCore *lc = [LinphoneManager getLc]; LinphoneCall *currentCall = linphone_core_get_current_call(lc); if (linphone_core_video_supported(lc)) { - if (linphone_core_video_enabled(lc) && currentCall && !linphone_call_media_in_progress(currentCall) && + if (linphone_core_video_display_enabled(lc) && currentCall && !linphone_call_media_in_progress(currentCall) && linphone_call_get_state(currentCall) == LinphoneCallStreamsRunning) { video_enabled = TRUE; } diff --git a/Classes/SettingsView.m b/Classes/SettingsView.m index b488d6160..d7946b495 100644 --- a/Classes/SettingsView.m +++ b/Classes/SettingsView.m @@ -586,7 +586,7 @@ static UICompositeViewDescription *compositeDescription = nil; [hiddenKeys addObject:@"enable_video_preference"]; } - if (!linphone_core_video_enabled([LinphoneManager getLc])) { + if (!linphone_core_video_display_enabled([LinphoneManager getLc])) { [hiddenKeys addObject:@"video_menu"]; } diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 251ba6fe1..3580fdfe9 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -90,7 +90,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info address = [[address componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] componentsJoinedByString:@" "]; NSString *normalizedSipAddress = nil; - LinphoneAddress *linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], [address UTF8String]); + LinphoneAddress *linphoneAddress = linphone_proxy_config_normalize_sip_uri(NULL, [address UTF8String]); if (linphoneAddress != NULL) { char *tmp = linphone_address_as_string_uri_only(linphoneAddress); if (tmp != NULL) { diff --git a/Classes/Utils/FileTransferDelegate.m b/Classes/Utils/FileTransferDelegate.m index a46bffeab..9dc257179 100644 --- a/Classes/Utils/FileTransferDelegate.m +++ b/Classes/Utils/FileTransferDelegate.m @@ -142,7 +142,7 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m - (void)upload:(UIImage *)image withURL:(NSURL *)url forChatRoom:(LinphoneChatRoom *)chatRoom { [LinphoneManager.instance.fileTransferDelegates addObject:self]; - LinphoneContent *content = linphone_core_create_content(linphone_chat_room_get_lc(chatRoom)); + LinphoneContent *content = linphone_core_create_content(linphone_chat_room_get_core(chatRoom)); _data = [NSMutableData dataWithData:UIImageJPEGRepresentation(image, 1.0)]; linphone_content_set_type(content, "image"); linphone_content_set_subtype(content, "jpeg"); diff --git a/TestsUI/ChatTester.m b/TestsUI/ChatTester.m index 214b05317..e594ac4e2 100644 --- a/TestsUI/ChatTester.m +++ b/TestsUI/ChatTester.m @@ -179,7 +179,9 @@ LinphoneChatRoom *room = linphone_core_get_chat_room_from_uri(lc, [[self me] UTF8String]); // generate lots of messages... for (; count < 50; count++) { - linphone_chat_room_send_message(room, [[NSString stringWithFormat:@"Message %d", count + 1] UTF8String]); + LinphoneChatMessage *msg = + linphone_chat_room_create_message(room, [[NSString stringWithFormat:@"Message %d", count + 1] UTF8String]); + linphone_chat_room_send_chat_message(room, msg); } for (int i = 0; i < 25; i++) { diff --git a/TestsUI/LinphoneTestCase.m b/TestsUI/LinphoneTestCase.m index dcdbc5afe..a08b9c64c 100644 --- a/TestsUI/LinphoneTestCase.m +++ b/TestsUI/LinphoneTestCase.m @@ -79,7 +79,7 @@ LinphoneProxyConfig *cfg = (LinphoneProxyConfig *)proxies->data; const char *domain = linphone_proxy_config_get_domain(cfg); const char *identity = linphone_proxy_config_get_identity(cfg); - LinphoneAddress *addr = linphone_core_interpret_url(lc, identity); + LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, identity); const char *username = linphone_address_get_username(addr); if (addr && (username && strcmp(username, [[self me] UTF8String]) == 0) && diff --git a/submodules/cmake-builder b/submodules/cmake-builder index 6b32795f7..535ffb9d9 160000 --- a/submodules/cmake-builder +++ b/submodules/cmake-builder @@ -1 +1 @@ -Subproject commit 6b32795f7e97729884eaa537c921d477c10a874b +Subproject commit 535ffb9d91b071f9272cb3bf71e4e4dacc57371a diff --git a/submodules/linphone b/submodules/linphone index 91352ffcc..7228158af 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 91352ffccd1edba32f56794194b0cc2695acd387 +Subproject commit 7228158af0d723d642dbaa7e1c556dddb9cf78d7