Merge pull request #3446 from element-hq/feature/bma/sdkUpgrade
Rust sdk upgrade to 0.2.43
This commit is contained in:
@@ -162,7 +162,7 @@ jsoup = "org.jsoup:jsoup:1.18.1"
|
||||
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
|
||||
molecule-runtime = "app.cash.molecule:molecule-runtime:2.0.0"
|
||||
timber = "com.jakewharton.timber:timber:5.0.1"
|
||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.2.42"
|
||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.2.43"
|
||||
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
|
||||
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
|
||||
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
|
||||
|
||||
@@ -188,6 +188,7 @@ class RustMatrixRoom(
|
||||
innerRoom.pinnedEventsTimeline(
|
||||
internalIdPrefix = "pinned_events",
|
||||
maxEventsToLoad = 100u,
|
||||
maxConcurrentRequests = 10u,
|
||||
).let { inner ->
|
||||
createTimeline(inner, mode = Timeline.Mode.PINNED_EVENTS)
|
||||
}
|
||||
|
||||
@@ -61,9 +61,11 @@ import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.EditedContent
|
||||
import org.matrix.rustcomponents.sdk.EventTimelineItem
|
||||
import org.matrix.rustcomponents.sdk.FormattedBody
|
||||
import org.matrix.rustcomponents.sdk.MessageFormat
|
||||
import org.matrix.rustcomponents.sdk.PollData
|
||||
import org.matrix.rustcomponents.sdk.SendAttachmentJoinHandle
|
||||
import org.matrix.rustcomponents.sdk.use
|
||||
import timber.log.Timber
|
||||
@@ -274,8 +276,15 @@ class RustTimeline(
|
||||
withContext(dispatcher) {
|
||||
runCatching<Unit> {
|
||||
getEventTimelineItem(originalEventId, transactionId).use { item ->
|
||||
val editedContent = EditedContent.RoomMessage(
|
||||
content = MessageEventContent.from(
|
||||
body = body,
|
||||
htmlBody = htmlBody,
|
||||
intentionalMentions = intentionalMentions
|
||||
),
|
||||
)
|
||||
inner.edit(
|
||||
newContent = MessageEventContent.from(body, htmlBody, intentionalMentions),
|
||||
newContent = editedContent,
|
||||
item = item,
|
||||
)
|
||||
}
|
||||
@@ -434,16 +443,21 @@ class RustTimeline(
|
||||
inner.getEventTimelineItemByEventId(
|
||||
eventId = pollStartId.value
|
||||
)
|
||||
pollStartEvent.use {
|
||||
inner.editPoll(
|
||||
val editedContent = EditedContent.PollStart(
|
||||
pollData = PollData(
|
||||
question = question,
|
||||
answers = answers,
|
||||
maxSelections = maxSelections.toUByte(),
|
||||
pollKind = pollKind.toInner(),
|
||||
editItem = pollStartEvent,
|
||||
),
|
||||
)
|
||||
pollStartEvent.use {
|
||||
inner.edit(
|
||||
newContent = editedContent,
|
||||
item = it,
|
||||
)
|
||||
}
|
||||
}
|
||||
}.map { }
|
||||
}
|
||||
|
||||
override suspend fun sendPollResponse(
|
||||
|
||||
Reference in New Issue
Block a user