Fix API break
This commit is contained in:
parent
d5b722fe3a
commit
16efeb1937
2 changed files with 20 additions and 4 deletions
|
|
@ -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,15 +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,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue