From 5a67275b89704ee57f9c351922d2b2d4008b5ee4 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 29 Sep 2022 17:58:45 +0100 Subject: [PATCH] parsing redacted events --- .../matrix/sync/internal/request/ApiTimelineEvent.kt | 10 +++++++++- .../sync/internal/sync/TimelineEventsProcessor.kt | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiTimelineEvent.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiTimelineEvent.kt index 6a26b02..f4ecf19 100644 --- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiTimelineEvent.kt +++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiTimelineEvent.kt @@ -82,7 +82,6 @@ internal sealed class ApiTimelineEvent { ) } - @Serializable @SerialName("m.room.member") internal data class RoomMember( @@ -109,6 +108,15 @@ internal sealed class ApiTimelineEvent { } } + @Serializable + @SerialName("m.room.redaction") + internal data class RoomRedcation( + @SerialName("event_id") val id: EventId, + @SerialName("redacts") val redactedId: EventId, + @SerialName("origin_server_ts") val utcTimestamp: Long, + @SerialName("sender") val senderId: UserId, + ) : ApiTimelineEvent() + @Serializable internal data class DecryptionStatus( @SerialName("is_verified") val isVerified: Boolean diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/TimelineEventsProcessor.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/TimelineEventsProcessor.kt index 0ac76c1..419bd9c 100644 --- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/TimelineEventsProcessor.kt +++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/TimelineEventsProcessor.kt @@ -32,6 +32,7 @@ internal class TimelineEventsProcessor( is ApiTimelineEvent.TimelineMessage -> event.toRoomEvent(roomToProcess.userCredentials, roomToProcess.roomId) { eventId -> eventLookupUseCase.lookup(eventId, decryptedTimeline, decryptedPreviousEvents) } + is ApiTimelineEvent.RoomRedcation -> null is ApiTimelineEvent.Encryption -> null is ApiTimelineEvent.RoomAvatar -> null is ApiTimelineEvent.RoomCreate -> null