[Message Actions] Display debug info for events in the timeline (#555)

* Display debug info for events in the timeline on debug builds.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2023-06-09 08:13:22 +02:00 committed by GitHub
parent 6b19ad380b
commit 688ab3bd5e
20 changed files with 371 additions and 34 deletions

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2023 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.libraries.matrix.api.timeline.item
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
@Parcelize
data class TimelineItemDebugInfo(
val model: String,
val originalJson: String?,
val latestEditedJson: String?,
) : Parcelable

View file

@ -18,6 +18,7 @@ package io.element.android.libraries.matrix.api.timeline.item.event
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.api.timeline.item.TimelineItemDebugInfo
data class EventTimelineItem(
val uniqueIdentifier: String,
@ -31,7 +32,8 @@ data class EventTimelineItem(
val sender: UserId,
val senderProfile: ProfileTimelineDetails,
val timestamp: Long,
val content: EventContent
val content: EventContent,
val debugInfo: TimelineItemDebugInfo,
) {
fun inReplyTo(): InReplyTo? {
return (content as? MessageContent)?.inReplyTo