replacing sealed class with interface

This commit is contained in:
Adam Brown 2022-10-01 11:28:06 +01:00 committed by Adam Brown
parent fa177de185
commit 7a8b91a376
1 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ interface MessageService : MatrixService {
} }
@Serializable @Serializable
sealed class Message { sealed interface Message {
@Serializable @Serializable
@SerialName("text_message") @SerialName("text_message")
data class TextMessage( data class TextMessage(
@ -40,7 +40,7 @@ interface MessageService : MatrixService {
@SerialName("local_id") val localId: String, @SerialName("local_id") val localId: String,
@SerialName("timestamp") val timestampUtc: Long, @SerialName("timestamp") val timestampUtc: Long,
@SerialName("reply") val reply: Reply? = null, @SerialName("reply") val reply: Reply? = null,
) : Message() { ) : Message {
@Serializable @Serializable
data class Reply( data class Reply(
val authorId: UserId, val authorId: UserId,
@ -58,7 +58,7 @@ interface MessageService : MatrixService {
@SerialName("room_id") val roomId: RoomId, @SerialName("room_id") val roomId: RoomId,
@SerialName("local_id") val localId: String, @SerialName("local_id") val localId: String,
@SerialName("timestamp") val timestampUtc: Long, @SerialName("timestamp") val timestampUtc: Long,
) : Message() ) : Message
@Serializable @Serializable
sealed class Content { sealed class Content {