Skip to content

Commit 90ad961

Browse files
renovate[bot]jmartinespElementBot
authored
Update dependency org.matrix.rustcomponents:sdk-android to v25.8.18 (#5182)
* Update dependency org.matrix.rustcomponents:sdk-android to v25.8.18 * Fix broken API changes: - The send queue usage is now mandatory. - The media upload progress now comes back in the send queue state (this still hasn't been applied to the UI in the timeline). * Update screenshots --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <[email protected]> Co-authored-by: ElementBot <[email protected]>
1 parent c6ca70b commit 90ad961

File tree

27 files changed

+85
-147
lines changed

27 files changed

+85
-147
lines changed

features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomPresenter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,6 @@ class ConfigureRoomPresenter @Inject constructor(
203203
mediaOptimizationConfig = mediaOptimizationConfigProvider.get(),
204204
).getOrThrow()
205205
val byteArray = preprocessed.file.readBytes()
206-
return matrixClient.uploadMedia(MimeTypes.Jpeg, byteArray, null).getOrThrow()
206+
return matrixClient.uploadMedia(MimeTypes.Jpeg, byteArray).getOrThrow()
207207
}
208208
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import io.element.android.libraries.core.mimetype.MimeTypes.isMimeTypeImage
3232
import io.element.android.libraries.core.mimetype.MimeTypes.isMimeTypeVideo
3333
import io.element.android.libraries.di.annotations.SessionCoroutineScope
3434
import io.element.android.libraries.matrix.api.core.EventId
35-
import io.element.android.libraries.matrix.api.core.ProgressCallback
3635
import io.element.android.libraries.matrix.api.permalink.PermalinkBuilder
3736
import io.element.android.libraries.mediaupload.api.MediaOptimizationConfig
3837
import io.element.android.libraries.mediaupload.api.MediaSender
@@ -47,7 +46,6 @@ import kotlinx.coroutines.Job
4746
import kotlinx.coroutines.isActive
4847
import kotlinx.coroutines.launch
4948
import timber.log.Timber
50-
import kotlin.coroutines.coroutineContext
5149

5250
class AttachmentsPreviewPresenter @AssistedInject constructor(
5351
@Assisted private val attachment: Attachment,
@@ -304,20 +302,11 @@ class AttachmentsPreviewPresenter @AssistedInject constructor(
304302
dismissAfterSend: Boolean,
305303
inReplyToEventId: EventId?,
306304
) = runCatchingExceptions {
307-
val context = coroutineContext
308-
val progressCallback = object : ProgressCallback {
309-
override fun onProgress(current: Long, total: Long) {
310-
// Note will not happen if useSendQueue is true
311-
if (context.isActive) {
312-
sendActionState.value = SendActionState.Sending.Uploading(current.toFloat() / total.toFloat(), mediaUploadInfo)
313-
}
314-
}
315-
}
305+
sendActionState.value = SendActionState.Sending.Uploading(mediaUploadInfo)
316306
mediaSender.sendPreProcessedMedia(
317307
mediaUploadInfo = mediaUploadInfo,
318308
caption = caption,
319309
formattedCaption = null,
320-
progressCallback = progressCallback,
321310
inReplyToEventId = inReplyToEventId,
322311
).getOrThrow()
323312
}.fold(

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sealed interface SendActionState {
3030
sealed interface Sending : SendActionState {
3131
data class Processing(val displayProgress: Boolean) : Sending
3232
data class ReadyToUpload(val mediaInfo: MediaUploadInfo) : Sending
33-
data class Uploading(val progress: Float, val mediaUploadInfo: MediaUploadInfo) : Sending
33+
data class Uploading(val mediaUploadInfo: MediaUploadInfo) : Sending
3434
}
3535

3636
data class Failure(val error: Throwable, val mediaUploadInfo: MediaUploadInfo?) : SendActionState

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewStateProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ open class AttachmentsPreviewStateProvider : PreviewParameterProvider<Attachment
3939
),
4040
anAttachmentsPreviewState(sendActionState = SendActionState.Sending.Processing(displayProgress = true)),
4141
anAttachmentsPreviewState(sendActionState = SendActionState.Sending.ReadyToUpload(aMediaUploadInfo())),
42-
anAttachmentsPreviewState(sendActionState = SendActionState.Sending.Uploading(0.5f, aMediaUploadInfo())),
42+
anAttachmentsPreviewState(sendActionState = SendActionState.Sending.Uploading(aMediaUploadInfo())),
4343
anAttachmentsPreviewState(sendActionState = SendActionState.Failure(RuntimeException("error"), aMediaUploadInfo())),
4444
anAttachmentsPreviewState(displayFileTooLargeError = true),
4545
anAttachmentsPreviewState(

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private fun AttachmentSendStateView(
143143
}
144144
is SendActionState.Sending.Uploading -> {
145145
ProgressDialog(
146-
type = ProgressDialogType.Determinate(sendActionState.progress),
146+
type = ProgressDialogType.Indeterminate,
147147
text = stringResource(id = CommonStrings.common_sending),
148148
showCancelButton = true,
149149
onDismissRequest = onDismissClick,

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/MessageComposerPresenter.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ class MessageComposerPresenter @AssistedInject constructor(
510510
mediaSender.sendMedia(
511511
uri = uri,
512512
mimeType = mimeType,
513-
progressCallback = null,
514513
mediaOptimizationConfig = mediaOptimizationConfigProvider.get(),
515514
).getOrThrow()
516515
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventForTimestampViewProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TimelineItemEventForTimestampViewProvider : PreviewParameterProvider<Timel
1919
override val values: Sequence<TimelineItem.Event>
2020
get() = sequenceOf(
2121
aTimelineItemEvent(),
22-
aTimelineItemEvent().copy(localSendState = LocalEventSendState.Sending),
22+
aTimelineItemEvent().copy(localSendState = LocalEventSendState.Sending.Event),
2323
aTimelineItemEvent().copy(localSendState = LocalEventSendState.Failed.Unknown("AN_ERROR")),
2424
// Edited
2525
aTimelineItemEvent().copy(content = aTimelineItemTextContent().copy(isEdited = true)),

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/ReadReceiptViewStateForTimelineItemEventRowProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ReadReceiptViewStateForTimelineItemEventRowProvider :
1717
override val values: Sequence<ReadReceiptViewState>
1818
get() = sequenceOf(
1919
aReadReceiptViewState(
20-
sendState = LocalEventSendState.Sending,
20+
sendState = LocalEventSendState.Sending.Event,
2121
),
2222
aReadReceiptViewState(
2323
sendState = LocalEventSendState.Sent(EventId("\$eventId")),

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/ReadReceiptViewStateProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ReadReceiptViewStateProvider : PreviewParameterProvider<ReadReceiptViewSta
2020
override val values: Sequence<ReadReceiptViewState>
2121
get() = sequenceOf(
2222
aReadReceiptViewState(),
23-
aReadReceiptViewState(sendState = LocalEventSendState.Sending),
23+
aReadReceiptViewState(sendState = LocalEventSendState.Sending.Event),
2424
aReadReceiptViewState(sendState = LocalEventSendState.Sent(EventId("\$eventId"))),
2525
aReadReceiptViewState(
2626
sendState = LocalEventSendState.Sent(EventId("\$eventId")),

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/TimelineItemReadReceiptView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fun TimelineItemReadReceiptView(
7676
}
7777
} else {
7878
when (state.sendState) {
79-
LocalEventSendState.Sending -> {
79+
is LocalEventSendState.Sending -> {
8080
ReadReceiptsRow(modifier) {
8181
Icon(
8282
modifier = Modifier.padding(2.dp),

0 commit comments

Comments
 (0)