moving the ApiMessage to the message module
This commit is contained in:
parent
b2ff6cba56
commit
49ae369e38
|
@ -31,7 +31,7 @@ import app.dapk.st.matrix.crypto.cryptoService
|
|||
import app.dapk.st.matrix.crypto.installCryptoService
|
||||
import app.dapk.st.matrix.device.deviceService
|
||||
import app.dapk.st.matrix.device.installEncryptionService
|
||||
import app.dapk.st.matrix.device.internal.ApiMessage
|
||||
import app.dapk.st.matrix.message.internal.ApiMessage
|
||||
import app.dapk.st.matrix.http.MatrixHttpClient
|
||||
import app.dapk.st.matrix.http.ktor.KtorMatrixHttpClientFactory
|
||||
import app.dapk.st.matrix.message.MessageEncrypter
|
||||
|
|
|
@ -6,8 +6,6 @@ import app.dapk.st.matrix.device.DeviceService.OneTimeKeys.Key.SignedCurve.Ed255
|
|||
import app.dapk.st.matrix.device.KnownDeviceStore
|
||||
import app.dapk.st.matrix.device.ToDevicePayload
|
||||
import app.dapk.st.matrix.http.MatrixHttpClient
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
import java.util.*
|
||||
|
@ -141,22 +139,3 @@ internal class DefaultDeviceService(
|
|||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
sealed class ApiMessage {
|
||||
|
||||
@Serializable
|
||||
@SerialName("text_message")
|
||||
data class TextMessage(
|
||||
@SerialName("content") val content: TextContent,
|
||||
@SerialName("room_id") val roomId: RoomId,
|
||||
@SerialName("type") val type: String,
|
||||
) : ApiMessage() {
|
||||
|
||||
@Serializable
|
||||
data class TextContent(
|
||||
@SerialName("body") val body: String,
|
||||
@SerialName("msgtype") val type: String = MessageType.TEXT.value,
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package app.dapk.st.matrix.message.internal
|
||||
|
||||
import app.dapk.st.matrix.common.MessageType
|
||||
import app.dapk.st.matrix.common.RoomId
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
sealed class ApiMessage {
|
||||
|
||||
@Serializable
|
||||
@SerialName("text_message")
|
||||
data class TextMessage(
|
||||
@SerialName("content") val content: TextContent,
|
||||
@SerialName("room_id") val roomId: RoomId,
|
||||
@SerialName("type") val type: String,
|
||||
) : ApiMessage() {
|
||||
|
||||
@Serializable
|
||||
data class TextContent(
|
||||
@SerialName("body") val body: String,
|
||||
@SerialName("msgtype") val type: String = MessageType.TEXT.value,
|
||||
)
|
||||
}
|
||||
|
||||
}
|
|
@ -16,7 +16,7 @@ import app.dapk.st.matrix.crypto.cryptoService
|
|||
import app.dapk.st.matrix.crypto.installCryptoService
|
||||
import app.dapk.st.matrix.device.deviceService
|
||||
import app.dapk.st.matrix.device.installEncryptionService
|
||||
import app.dapk.st.matrix.device.internal.ApiMessage
|
||||
import app.dapk.st.matrix.message.internal.ApiMessage
|
||||
import app.dapk.st.matrix.http.MatrixHttpClient
|
||||
import app.dapk.st.matrix.http.ktor.KtorMatrixHttpClientFactory
|
||||
import app.dapk.st.matrix.message.MessageEncrypter
|
||||
|
|
Loading…
Reference in New Issue