mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 11:26:01 +03:00
post rebase fix
This commit is contained in:
parent
55dcba6f36
commit
dd09c4a72d
3 changed files with 6 additions and 7 deletions
|
@ -30,7 +30,6 @@ import org.matrix.android.sdk.internal.crypto.attachments.MXEncryptedAttachments
|
|||
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileInfo
|
||||
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileKey
|
||||
import org.matrix.android.sdk.internal.crypto.attachments.toElementToDecrypt
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.InputStream
|
||||
|
||||
/**
|
||||
|
|
|
@ -109,9 +109,9 @@ internal class FileUploader @Inject constructor(@Authenticated
|
|||
filename: String?,
|
||||
mimeType: String?,
|
||||
progressListener: ProgressRequestBody.Listener? = null): ContentUploadResponse {
|
||||
return withContext(Dispatchers.IO) {
|
||||
val inputStream = context.contentResolver.openInputStream(uri) ?: throw FileNotFoundException()
|
||||
|
||||
val inputStream = withContext(Dispatchers.IO) {
|
||||
context.contentResolver.openInputStream(uri)
|
||||
} ?: throw FileNotFoundException()
|
||||
return uploadInputStream(inputStream, filename, mimeType, progressListener)
|
||||
}
|
||||
private suspend fun upload(uploadBody: RequestBody, filename: String?, progressListener: ProgressRequestBody.Listener?): ContentUploadResponse {
|
||||
|
|
|
@ -75,10 +75,10 @@ internal class SendEventWorker(context: Context,
|
|||
.also { Timber.e("Work cancelled due to bad input data") }
|
||||
}
|
||||
|
||||
if (cancelSendTracker.isCancelRequestedFor(params.eventId, params.roomId)) {
|
||||
if (cancelSendTracker.isCancelRequestedFor(params.eventId, event.roomId)) {
|
||||
return Result.success()
|
||||
.also {
|
||||
cancelSendTracker.markCancelled(params.eventId, params.roomId)
|
||||
cancelSendTracker.markCancelled(event.eventId, event.roomId)
|
||||
Timber.e("## SendEvent: Event sending has been cancelled ${params.eventId}")
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ internal class SendEventWorker(context: Context,
|
|||
} catch (exception: Throwable) {
|
||||
if (/*currentAttemptCount >= MAX_NUMBER_OF_RETRY_BEFORE_FAILING ||**/ !exception.shouldBeRetried()) {
|
||||
Timber.e("## SendEvent: [${System.currentTimeMillis()}] Send event Failed cannot retry ${params.eventId} > ${exception.localizedMessage}")
|
||||
localEchoRepository.updateSendState(params.eventId, SendState.UNDELIVERED)
|
||||
localEchoRepository.updateSendState(event.eventId, SendState.UNDELIVERED)
|
||||
return Result.success()
|
||||
} else {
|
||||
Timber.e("## SendEvent: [${System.currentTimeMillis()}] Send event Failed schedule retry ${params.eventId} > ${exception.localizedMessage}")
|
||||
|
|
Loading…
Reference in a new issue