post rebase fix

This commit is contained in:
Valere 2020-08-31 09:23:29 +02:00
parent 55dcba6f36
commit dd09c4a72d
3 changed files with 6 additions and 7 deletions

View file

@ -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
/** /**

View file

@ -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 {

View file

@ -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}")