From 01614301800b4a8be1fe46d041205a0a58516f35 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Mon, 12 Apr 2021 18:00:13 +0200 Subject: [PATCH] enable display image if vfs not enabled --- Classes/LinphoneUI/UIChatBubblePhotoCell.m | 2 +- Classes/LinphoneUI/UIChatBubbleTextCell.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneUI/UIChatBubblePhotoCell.m b/Classes/LinphoneUI/UIChatBubblePhotoCell.m index e6dfd2b16..6ce7def06 100644 --- a/Classes/LinphoneUI/UIChatBubblePhotoCell.m +++ b/Classes/LinphoneUI/UIChatBubblePhotoCell.m @@ -203,7 +203,7 @@ static const CGFloat CELL_IMAGE_X_MARGIN = 100; NSString *fileName = [NSString stringWithUTF8String:linphone_content_get_name(fileContent)]; if (!filePath) { - char *cPath = linphone_content_get_plain_file_path(fileContent); + char *cPath = [[LinphoneManager instance] lpConfigBoolForKey:@"vfs_enabled_preference"] ? linphone_content_get_plain_file_path(fileContent) : NULL; if (cPath) { filePath = [NSString stringWithUTF8String:cPath]; ms_free(cPath); diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.m b/Classes/LinphoneUI/UIChatBubbleTextCell.m index 3509b9772..42d35b259 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.m +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.m @@ -287,9 +287,9 @@ dispatch_async(dispatch_get_main_queue(), ^ { LinphoneContent *fileContent = linphone_chat_message_get_file_transfer_information(_message); NSData *data = NULL; - char *cPath = linphone_content_get_plain_file_path(fileContent); + char *cPath = [[LinphoneManager instance] lpConfigBoolForKey:@"vfs_enabled_preference"] ? linphone_content_get_plain_file_path(fileContent) : NULL; if (cPath) { - NSString *filePath = [NSString stringWithUTF8String:linphone_content_get_plain_file_path(fileContent)]; + NSString *filePath = [NSString stringWithUTF8String:cPath]; data = [NSData dataWithContentsOfFile:filePath]; ms_free(cPath); [[NSFileManager defaultManager] removeItemAtPath:filePath error:NULL];