set values to not nullable in ChatMessage wherever this makes sense

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-08-12 14:09:05 +02:00
parent a632765cce
commit 76e6bb0f82
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
2 changed files with 17 additions and 17 deletions

View file

@ -20,17 +20,17 @@ fun ChatMessageJson.asEntity(accountId: Long) =
accountId = accountId, accountId = accountId,
id = id, id = id,
internalConversationId = "$accountId@$token", internalConversationId = "$accountId@$token",
message = message, message = message!!,
token = token, token = token!!,
actorType = actorType, actorType = actorType!!,
actorId = actorId, actorId = actorId!!,
actorDisplayName = actorDisplayName, actorDisplayName = actorDisplayName!!,
timestamp = timestamp, timestamp = timestamp,
messageParameters = messageParameters, messageParameters = messageParameters,
systemMessageType = systemMessageType, systemMessageType = systemMessageType!!,
replyable = replyable, replyable = replyable,
parentMessageId = parentMessage?.id, parentMessageId = parentMessage?.id,
messageType = messageType, messageType = messageType!!,
reactions = reactions, reactions = reactions,
reactionsSelf = reactionsSelf, reactionsSelf = reactionsSelf,
expirationTimestamp = expirationTimestamp, expirationTimestamp = expirationTimestamp,

View file

@ -34,27 +34,27 @@ data class ChatMessageEntity(
@PrimaryKey @PrimaryKey
// accountId@roomtoken@messageId // accountId@roomtoken@messageId
@ColumnInfo(name = "internalId") var internalId: String, @ColumnInfo(name = "internalId") var internalId: String,
@ColumnInfo(name = "accountId") var accountId: Long? = null, @ColumnInfo(name = "accountId") var accountId: Long,
@ColumnInfo(name = "token") var token: String? = null, @ColumnInfo(name = "token") var token: String,
@ColumnInfo(name = "id") var id: Long = 0, @ColumnInfo(name = "id") var id: Long = 0,
// accountId@roomtoken // accountId@roomtoken
@ColumnInfo(name = "internalConversationId") var internalConversationId: String? = null, @ColumnInfo(name = "internalConversationId") var internalConversationId: String,
@ColumnInfo(name = "actorType") var actorType: String? = null, @ColumnInfo(name = "actorType") var actorType: String,
@ColumnInfo(name = "actorId") var actorId: String? = null, @ColumnInfo(name = "actorId") var actorId: String,
@ColumnInfo(name = "actorDisplayName") var actorDisplayName: String? = null, @ColumnInfo(name = "actorDisplayName") var actorDisplayName: String,
@ColumnInfo(name = "timestamp") var timestamp: Long = 0, @ColumnInfo(name = "timestamp") var timestamp: Long = 0,
@ColumnInfo(name = "systemMessage") var systemMessageType: ChatMessage.SystemMessageType? = null, @ColumnInfo(name = "systemMessage") var systemMessageType: ChatMessage.SystemMessageType,
@ColumnInfo(name = "messageType") var messageType: String? = null, @ColumnInfo(name = "messageType") var messageType: String,
@ColumnInfo(name = "isReplyable") var replyable: Boolean = false, @ColumnInfo(name = "isReplyable") var replyable: Boolean = false,
// missing/not needed: referenceId // missing/not needed: referenceId
@ColumnInfo(name = "message") var message: String? = null, @ColumnInfo(name = "message") var message: String,
@ColumnInfo(name = "messageParameters") var messageParameters: HashMap<String?, HashMap<String?, String?>>? = null, @ColumnInfo(name = "messageParameters") var messageParameters: HashMap<String?, HashMap<String?, String?>>? = null,
@ColumnInfo(name = "expirationTimestamp") var expirationTimestamp: Int = 0, @ColumnInfo(name = "expirationTimestamp") var expirationTimestamp: Int = 0,
@ColumnInfo(name = "parent") var parentMessageId: Long? = null, @ColumnInfo(name = "parent") var parentMessageId: Long? = null,
@ColumnInfo(name = "reactions") var reactions: LinkedHashMap<String, Int>? = null, @ColumnInfo(name = "reactions") var reactions: LinkedHashMap<String, Int>? = null,
@ColumnInfo(name = "reactionsSelf") var reactionsSelf: ArrayList<String>? = null, @ColumnInfo(name = "reactionsSelf") var reactionsSelf: ArrayList<String>? = null,
@ColumnInfo(name = "markdown") var renderMarkdown: Boolean? = null, @ColumnInfo(name = "markdown") var renderMarkdown: Boolean? = false,
@ColumnInfo(name = "lastEditActorType") var lastEditActorType: String? = null, @ColumnInfo(name = "lastEditActorType") var lastEditActorType: String? = null,
@ColumnInfo(name = "lastEditActorId") var lastEditActorId: String? = null, @ColumnInfo(name = "lastEditActorId") var lastEditActorId: String? = null,
@ColumnInfo(name = "lastEditActorDisplayName") var lastEditActorDisplayName: String? = null, @ColumnInfo(name = "lastEditActorDisplayName") var lastEditActorDisplayName: String? = null,