Update dependency org.matrix.rustcomponents:sdk-android to v0.2.50 (#3565)
* Adapt to changes in the SDK * Update dependency org.matrix.rustcomponents:sdk-android to v0.2.50 * Use lambda instead of overriding the `EventDebugInfoProvider` interface * Fix test proposal. We may find a better way to compare data class instance if we need to do more comparison in the future... --------- Co-authored-by: Jorge Martín <jorgem@element.io> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benoit Marty <benoit@matrix.org>
This commit is contained in:
parent
249104bf38
commit
3001efb525
26 changed files with 216 additions and 175 deletions
|
|
@ -162,7 +162,7 @@ internal fun aTimelineItemEvent(
|
|||
groupPosition = groupPosition,
|
||||
localSendState = sendState,
|
||||
inReplyTo = inReplyTo,
|
||||
debugInfo = debugInfo,
|
||||
debugInfoProvider = { debugInfo },
|
||||
isThreaded = isThreaded,
|
||||
origin = null,
|
||||
messageShield = messageShield,
|
||||
|
|
|
|||
|
|
@ -85,9 +85,9 @@ class TimelineItemEventFactory @AssistedInject constructor(
|
|||
localSendState = currentTimelineItem.event.localSendState,
|
||||
inReplyTo = currentTimelineItem.event.inReplyTo()?.map(permalinkParser = permalinkParser),
|
||||
isThreaded = currentTimelineItem.event.isThreaded(),
|
||||
debugInfo = currentTimelineItem.event.debugInfo,
|
||||
debugInfoProvider = currentTimelineItem.event.debugInfoProvider,
|
||||
origin = currentTimelineItem.event.origin,
|
||||
messageShield = currentTimelineItem.event.messageShield,
|
||||
messageShield = currentTimelineItem.event.messageShieldProvider.getShield(strict = false)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.matrix.api.core.EventId
|
|||
import io.element.android.libraries.matrix.api.core.TransactionId
|
||||
import io.element.android.libraries.matrix.api.core.UniqueId
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
import io.element.android.libraries.matrix.api.timeline.item.TimelineItemDebugInfo
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.EventDebugInfoProvider
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.LocalEventSendState
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.MessageShield
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.ProfileTimelineDetails
|
||||
|
|
@ -74,7 +74,7 @@ sealed interface TimelineItem {
|
|||
val localSendState: LocalEventSendState?,
|
||||
val inReplyTo: InReplyToDetails?,
|
||||
val isThreaded: Boolean,
|
||||
val debugInfo: TimelineItemDebugInfo,
|
||||
val debugInfoProvider: EventDebugInfoProvider,
|
||||
val origin: TimelineItemEventOrigin?,
|
||||
val messageShield: MessageShield?,
|
||||
) : TimelineItem {
|
||||
|
|
@ -89,6 +89,8 @@ sealed interface TimelineItem {
|
|||
val isSticker: Boolean = content is TimelineItemStickerContent
|
||||
|
||||
val isRemote = eventId != null
|
||||
|
||||
val debugInfo = debugInfoProvider.get()
|
||||
}
|
||||
|
||||
@Immutable
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ class MessagesPresenterTest {
|
|||
canUserPinUnpinResult = { Result.success(true) },
|
||||
)
|
||||
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(true) }
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(Unit) }
|
||||
liveTimeline.redactEventLambda = redactEventLambda
|
||||
|
||||
val presenter = createMessagesPresenter(matrixRoom = matrixRoom, coroutineDispatchers = coroutineDispatchers)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ internal fun aMessageEvent(
|
|||
readReceiptState = TimelineItemReadReceipts(emptyList<ReadReceiptData>().toImmutableList()),
|
||||
localSendState = sendState,
|
||||
inReplyTo = inReplyTo,
|
||||
debugInfo = debugInfo,
|
||||
debugInfoProvider = { debugInfo },
|
||||
isThreaded = isThreaded,
|
||||
origin = null,
|
||||
messageShield = messageShield,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class TimelineItemGrouperTest {
|
|||
canBeRepliedTo = false,
|
||||
inReplyTo = null,
|
||||
isThreaded = false,
|
||||
debugInfo = aTimelineItemDebugInfo(),
|
||||
debugInfoProvider = { aTimelineItemDebugInfo() },
|
||||
origin = null,
|
||||
messageShield = null,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -88,13 +88,15 @@ fun aRedactedMatrixTimeline(eventId: EventId) = listOf<MatrixTimelineItem>(
|
|||
senderProfile = ProfileTimelineDetails.Unavailable,
|
||||
timestamp = 9442,
|
||||
content = RedactedContent,
|
||||
debugInfo = TimelineItemDebugInfo(
|
||||
model = "enim",
|
||||
originalJson = null,
|
||||
latestEditedJson = null
|
||||
),
|
||||
debugInfoProvider = {
|
||||
TimelineItemDebugInfo(
|
||||
model = "enim",
|
||||
originalJson = null,
|
||||
latestEditedJson = null
|
||||
)
|
||||
},
|
||||
origin = null,
|
||||
messageShield = null,
|
||||
messageShieldProvider = { null },
|
||||
),
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class PollRepository @Inject constructor(
|
|||
|
||||
suspend fun deletePoll(
|
||||
pollStartId: EventId,
|
||||
): Result<Boolean> =
|
||||
): Result<Unit> =
|
||||
timelineProvider
|
||||
.getActiveTimeline()
|
||||
.redactEvent(
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ class CreatePollPresenterTest {
|
|||
@Test
|
||||
fun `delete confirms`() = runTest {
|
||||
val presenter = createCreatePollPresenter(mode = CreatePollMode.EditPoll(pollEventId))
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(true) }
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(Unit) }
|
||||
timeline.redactEventLambda = redactEventLambda
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -481,7 +481,7 @@ class CreatePollPresenterTest {
|
|||
@Test
|
||||
fun `delete can be cancelled`() = runTest {
|
||||
val presenter = createCreatePollPresenter(mode = CreatePollMode.EditPoll(pollEventId))
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(true) }
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(Unit) }
|
||||
timeline.redactEventLambda = redactEventLambda
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -499,7 +499,7 @@ class CreatePollPresenterTest {
|
|||
@Test
|
||||
fun `delete can be confirmed`() = runTest {
|
||||
val presenter = createCreatePollPresenter(mode = CreatePollMode.EditPoll(pollEventId))
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(true) }
|
||||
val redactEventLambda = lambdaRecorder { _: EventId?, _: TransactionId?, _: String? -> Result.success(Unit) }
|
||||
timeline.redactEventLambda = redactEventLambda
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue