diff --git a/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt b/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt index ca4a411b5..07ef49fbf 100644 --- a/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt @@ -20,17 +20,17 @@ fun ChatMessageJson.asEntity(accountId: Long) = accountId = accountId, id = id, internalConversationId = "$accountId@$token", - message = message, - token = token, - actorType = actorType, - actorId = actorId, - actorDisplayName = actorDisplayName, + message = message!!, + token = token!!, + actorType = actorType!!, + actorId = actorId!!, + actorDisplayName = actorDisplayName!!, timestamp = timestamp, messageParameters = messageParameters, - systemMessageType = systemMessageType, + systemMessageType = systemMessageType!!, replyable = replyable, parentMessageId = parentMessage?.id, - messageType = messageType, + messageType = messageType!!, reactions = reactions, reactionsSelf = reactionsSelf, expirationTimestamp = expirationTimestamp, diff --git a/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt b/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt index 956559ee3..3783cb711 100644 --- a/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt +++ b/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt @@ -34,27 +34,27 @@ data class ChatMessageEntity( @PrimaryKey // accountId@roomtoken@messageId @ColumnInfo(name = "internalId") var internalId: String, - @ColumnInfo(name = "accountId") var accountId: Long? = null, - @ColumnInfo(name = "token") var token: String? = null, + @ColumnInfo(name = "accountId") var accountId: Long, + @ColumnInfo(name = "token") var token: String, @ColumnInfo(name = "id") var id: Long = 0, // accountId@roomtoken - @ColumnInfo(name = "internalConversationId") var internalConversationId: String? = null, + @ColumnInfo(name = "internalConversationId") var internalConversationId: String, - @ColumnInfo(name = "actorType") var actorType: String? = null, - @ColumnInfo(name = "actorId") var actorId: String? = null, - @ColumnInfo(name = "actorDisplayName") var actorDisplayName: String? = null, + @ColumnInfo(name = "actorType") var actorType: String, + @ColumnInfo(name = "actorId") var actorId: String, + @ColumnInfo(name = "actorDisplayName") var actorDisplayName: String, @ColumnInfo(name = "timestamp") var timestamp: Long = 0, - @ColumnInfo(name = "systemMessage") var systemMessageType: ChatMessage.SystemMessageType? = null, - @ColumnInfo(name = "messageType") var messageType: String? = null, + @ColumnInfo(name = "systemMessage") var systemMessageType: ChatMessage.SystemMessageType, + @ColumnInfo(name = "messageType") var messageType: String, @ColumnInfo(name = "isReplyable") var replyable: Boolean = false, // missing/not needed: referenceId - @ColumnInfo(name = "message") var message: String? = null, + @ColumnInfo(name = "message") var message: String, @ColumnInfo(name = "messageParameters") var messageParameters: HashMap>? = null, @ColumnInfo(name = "expirationTimestamp") var expirationTimestamp: Int = 0, @ColumnInfo(name = "parent") var parentMessageId: Long? = null, @ColumnInfo(name = "reactions") var reactions: LinkedHashMap? = null, @ColumnInfo(name = "reactionsSelf") var reactionsSelf: ArrayList? = null, - @ColumnInfo(name = "markdown") var renderMarkdown: Boolean? = null, + @ColumnInfo(name = "markdown") var renderMarkdown: Boolean? = false, @ColumnInfo(name = "lastEditActorType") var lastEditActorType: String? = null, @ColumnInfo(name = "lastEditActorId") var lastEditActorId: String? = null, @ColumnInfo(name = "lastEditActorDisplayName") var lastEditActorDisplayName: String? = null,