mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-25 07:48:08 +00:00
Fixed file transfer in chat if file was picked from generic file picker
This commit is contained in:
parent
2c9a15a007
commit
8f52182959
2 changed files with 10 additions and 4 deletions
|
|
@ -153,9 +153,15 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
) { files ->
|
||||
sendMessageViewModel.closeFilePickerBottomSheet()
|
||||
for (fileUri in files) {
|
||||
val path = fileUri.toString()
|
||||
Log.i("$TAG Picked file [$path]")
|
||||
sendMessageViewModel.addAttachment(path)
|
||||
lifecycleScope.launch {
|
||||
val path = FileUtils.getFilePath(requireContext(), fileUri, false).orEmpty()
|
||||
if (path.isNotEmpty()) {
|
||||
Log.i("$TAG Picked file [$path]")
|
||||
sendMessageViewModel.addAttachment(path)
|
||||
} else {
|
||||
Log.e("$TAG Failed to pick file [$fileUri]")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class FileUtils {
|
|||
Log.e(
|
||||
"$TAG Couldn't get URI for file [$file] using file provider ${context.getString(
|
||||
R.string.file_provider
|
||||
)}"
|
||||
)}: $e"
|
||||
)
|
||||
Uri.parse(path)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue