diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index d0fd58701..a1c07ea20 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -869,7 +869,7 @@ void on_chat_room_chat_message_received(LinphoneChatRoom *cr, const LinphoneEven BOOL hasFile = FALSE; // if auto_download is available and file is downloaded - if (([LinphoneManager.instance lpConfigIntForKey:@"auto_download_incoming_files_max_size" inSection:@"app"] > -1) && linphone_chat_message_get_file_transfer_information(chat)) + if ((linphone_core_get_max_size_for_auto_download_incoming_files(LC) > -1) && linphone_chat_message_get_file_transfer_information(chat)) hasFile = TRUE; if (!linphone_chat_message_is_file_transfer(chat) && !linphone_chat_message_is_text(chat) && !hasFile) /*probably an imdn*/ diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 81f182c78..8365b0a3c 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -336,6 +336,7 @@ { [self setInteger:linphone_core_lime_enabled(LC) forKey:@"use_lime_preference"]; [self setCString:linphone_core_get_file_transfer_server(LC) forKey:@"file_transfer_server_url_preference"]; + [self setInteger:linphone_core_get_max_size_for_auto_download_incoming_files(LC) forKey:@"auto_download_incoming_files_max_size"]; } // network section @@ -784,6 +785,7 @@ [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; } linphone_core_set_file_transfer_server(LC, [self stringForKey:@"file_transfer_server_url_preference"].UTF8String); + linphone_core_set_max_size_for_auto_download_incoming_files(LC, [[self stringForKey:@"auto_download_incoming_files_max_size"] intValue]); // network section BOOL edgeOpt = [self boolForKey:@"edge_opt_preference"]; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 9cbb67910..517fc8aef 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1127,7 +1127,7 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, LinphoneAut BOOL hasFile = FALSE; // if auto_download is available and file is downloaded - if (([LinphoneManager.instance lpConfigIntForKey:@"auto_download_incoming_files_max_size" inSection:@"app"] > -1) && linphone_chat_message_get_file_transfer_information(msg)) + if ((linphone_core_get_max_size_for_auto_download_incoming_files(LC) > -1) && linphone_chat_message_get_file_transfer_information(msg)) hasFile = TRUE; if (!linphone_chat_message_is_file_transfer(msg) && !linphone_chat_message_is_text(msg) && !hasFile) diff --git a/Settings/InAppSettings.bundle/Chat.plist b/Settings/InAppSettings.bundle/Chat.plist index 17739d229..159b17e14 100644 --- a/Settings/InAppSettings.bundle/Chat.plist +++ b/Settings/InAppSettings.bundle/Chat.plist @@ -4,6 +4,26 @@ PreferenceSpecifiers + + Type + PSGroupSpecifier + Title + Auto Download + + + Key + auto_download_incoming_files_max_size + Title + Files max size + DefaultValue + -1 + Type + PSTextFieldSpecifier + KeyboardType + NumbersAndPunctuation + IASKTextAlignment + IASKUITextAlignmentRight + DefaultValue 0