-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Milestone
Description
it seems that Ivan's realization of recognizing inline attachments works well. Just need to fix the Android side.
MsgBlock.Type.DECRYPTED_ATT -> {
if (tempDir != null) {
try {
val decryptedAtt: DecryptedAttMsgBlock = block as DecryptedAttMsgBlock
val fileName =
FileAndDirectoryUtils.normalizeFileName(decryptedAtt.attMeta.name)
val file = if (fileName.isNullOrEmpty()) {
File.createTempFile("tmp", null, tempDir)
} else {
val file = File(tempDir, fileName)
if (file.exists()) {
FileAndDirectoryUtils.createFileWithIncreasedIndex(tempDir, fileName)
} else {
file
}
}
FileUtils.writeByteArrayToFile(
file,
Base64.decode(decryptedAtt.attMeta.data, Base64.DEFAULT)
)
decryptedAtt.attMeta.data = null //clear raw info to prevent Binder exception
decryptedAtt.fileUri = Uri.fromFile(file)
msgBlocks?.add(decryptedAtt)
} catch (e: Exception) {
e.printStackTrace()
ExceptionUtil.handleError(e)
}
} else {
ExceptionUtil.handleError(IOException("The temp cache dir == null"))
}
}ref
Line 79 in 68d4a88
| MsgBlock.Type.DECRYPTED_ATT -> { |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
