enable display image if vfs not enabled

This commit is contained in:
Danmei Chen 2021-04-12 18:00:13 +02:00
parent deb245bcec
commit 0161430180
2 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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];