diff --git a/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt b/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt index 487f3cd9e..a9f390771 100644 --- a/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt +++ b/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt @@ -199,7 +199,8 @@ class ChatMessageContentData( downloadLabel.value = spannable if (content.isFile || (content.isFileTransfer && chatMessage.isOutgoing)) { - val path = if (content.isFileEncrypted) content.plainFilePath else content.filePath ?: "" + Log.i("[Content] Is content encrypted ? $isFileEncrypted") + val path = if (isFileEncrypted) content.plainFilePath else content.filePath ?: "" downloadable.value = content.filePath.orEmpty().isEmpty() if (path.isNotEmpty()) { diff --git a/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt b/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt index c79a1b74f..b9c13a7df 100644 --- a/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt +++ b/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt @@ -298,7 +298,7 @@ class DetailChatRoomFragment : MasterFragment { if (content.isFileEncrypted) { Log.w("[Chat Message] File is encrypted and can't be opened in one of our viewers...") - showDialogForUserConsentBeforeExportingFileInThirdPartyApp(path) + showDialogForUserConsentBeforeExportingFileInThirdPartyApp(content) } else if (!FileUtils.openFileInThirdPartyApp(requireActivity(), path)) { showDialogToSuggestOpeningFileAsText() } @@ -675,7 +675,7 @@ class DetailChatRoomFragment : MasterFragment + copyFileTo(plainFilePath, out) + } + } + return cacheFile.absolutePath + } catch (e: IOException) { + Log.e("[File Utils] copyFileToCache exception: $e") + } + return null + } + private fun createFile(file: String): File { var fileName = file diff --git a/app/src/main/res/xml/provider_paths.xml b/app/src/main/res/xml/provider_paths.xml index 5932c8903..07009997a 100644 --- a/app/src/main/res/xml/provider_paths.xml +++ b/app/src/main/res/xml/provider_paths.xml @@ -4,4 +4,5 @@ + \ No newline at end of file