mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 20:29:10 +03:00
DefaultFileService - code was passing the inputStream to the decryption method
but not storing the output of the method anywhere then it was writing inputStream to file and returning that file handle changed inputStream to var and used it to store output of decryption method
This commit is contained in:
parent
8c9c65837d
commit
1ae58aa6ad
1 changed files with 2 additions and 2 deletions
|
@ -74,7 +74,7 @@ internal class DefaultFileService @Inject constructor(private val context: Conte
|
|||
.build()
|
||||
|
||||
val response = okHttpClient.newCall(request).execute()
|
||||
val inputStream = response.body?.byteStream()
|
||||
var inputStream = response.body?.byteStream()
|
||||
Timber.v("Response size ${response.body?.contentLength()} - Stream available: ${inputStream?.available()}")
|
||||
if (!response.isSuccessful
|
||||
|| inputStream == null) {
|
||||
|
@ -83,7 +83,7 @@ internal class DefaultFileService @Inject constructor(private val context: Conte
|
|||
|
||||
if (elementToDecrypt != null) {
|
||||
Timber.v("## decrypt file")
|
||||
MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt)
|
||||
inputStream = MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt)
|
||||
?: throw IllegalStateException("Decryption error")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue