mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +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.EncryptedFileInfo
|
||||||
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileKey
|
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileKey
|
||||||
import org.matrix.android.sdk.internal.crypto.attachments.toElementToDecrypt
|
import org.matrix.android.sdk.internal.crypto.attachments.toElementToDecrypt
|
||||||
import java.io.ByteArrayInputStream
|
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -109,9 +109,9 @@ internal class FileUploader @Inject constructor(@Authenticated
|
||||||
filename: String?,
|
filename: String?,
|
||||||
mimeType: String?,
|
mimeType: String?,
|
||||||
progressListener: ProgressRequestBody.Listener? = null): ContentUploadResponse {
|
progressListener: ProgressRequestBody.Listener? = null): ContentUploadResponse {
|
||||||
return withContext(Dispatchers.IO) {
|
val inputStream = withContext(Dispatchers.IO) {
|
||||||
val inputStream = context.contentResolver.openInputStream(uri) ?: throw FileNotFoundException()
|
context.contentResolver.openInputStream(uri)
|
||||||
|
} ?: throw FileNotFoundException()
|
||||||
return uploadInputStream(inputStream, filename, mimeType, progressListener)
|
return uploadInputStream(inputStream, filename, mimeType, progressListener)
|
||||||
}
|
}
|
||||||
private suspend fun upload(uploadBody: RequestBody, filename: String?, progressListener: ProgressRequestBody.Listener?): ContentUploadResponse {
|
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") }
|
.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()
|
return Result.success()
|
||||||
.also {
|
.also {
|
||||||
cancelSendTracker.markCancelled(params.eventId, params.roomId)
|
cancelSendTracker.markCancelled(event.eventId, event.roomId)
|
||||||
Timber.e("## SendEvent: Event sending has been cancelled ${params.eventId}")
|
Timber.e("## SendEvent: Event sending has been cancelled ${params.eventId}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ internal class SendEventWorker(context: Context,
|
||||||
} catch (exception: Throwable) {
|
} catch (exception: Throwable) {
|
||||||
if (/*currentAttemptCount >= MAX_NUMBER_OF_RETRY_BEFORE_FAILING ||**/ !exception.shouldBeRetried()) {
|
if (/*currentAttemptCount >= MAX_NUMBER_OF_RETRY_BEFORE_FAILING ||**/ !exception.shouldBeRetried()) {
|
||||||
Timber.e("## SendEvent: [${System.currentTimeMillis()}] Send event Failed cannot retry ${params.eventId} > ${exception.localizedMessage}")
|
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()
|
return Result.success()
|
||||||
} else {
|
} else {
|
||||||
Timber.e("## SendEvent: [${System.currentTimeMillis()}] Send event Failed schedule retry ${params.eventId} > ${exception.localizedMessage}")
|
Timber.e("## SendEvent: [${System.currentTimeMillis()}] Send event Failed schedule retry ${params.eventId} > ${exception.localizedMessage}")
|
||||||
|
|
Loading…
Reference in a new issue