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