Add canStartCall to conversation entity

This commit is contained in:
Mario Danic 2019-12-19 23:54:36 +01:00
parent e47cb91210
commit cb73e9366d
No known key found for this signature in database
GPG Key ID: CDE0BBD2738C4CC0
2 changed files with 8 additions and 0 deletions

View File

@ -93,6 +93,9 @@ class Conversation {
var lobbyTimer: Long? = 0 var lobbyTimer: Long? = 0
@JsonField(name = ["lastReadMessageId"]) @JsonField(name = ["lastReadMessageId"])
var lastReadMessageId: Long = 0 var lastReadMessageId: Long = 0
@JsonField(name = ["canStartCall"])
var canStartCall: Boolean? = true
@JsonIgnore
var changing: Boolean = false var changing: Boolean = false
val isPublic: Boolean = ConversationType.PUBLIC_CONVERSATION == type val isPublic: Boolean = ConversationType.PUBLIC_CONVERSATION == type

View File

@ -72,6 +72,8 @@ data class ConversationEntity(
@ColumnInfo(name = "lobby_state") var lobbyState: LobbyState? = null, @ColumnInfo(name = "lobby_state") var lobbyState: LobbyState? = null,
@ColumnInfo(name = "lobby_timer") var lobbyTimer: Long? = null, @ColumnInfo(name = "lobby_timer") var lobbyTimer: Long? = null,
@ColumnInfo(name = "last_read_message") var lastReadMessageId: Long = 0, @ColumnInfo(name = "last_read_message") var lastReadMessageId: Long = 0,
@ColumnInfo(name = "can_start_call") var canStartCall: Boolean? = true,
@ColumnInfo(name = "modified_at") var modifiedAt: Long? = null, @ColumnInfo(name = "modified_at") var modifiedAt: Long? = null,
@ColumnInfo(name = "changing") var changing: Boolean = false @ColumnInfo(name = "changing") var changing: Boolean = false
) { ) {
@ -104,6 +106,7 @@ data class ConversationEntity(
if (conversationReadOnlyState != other.conversationReadOnlyState) return false if (conversationReadOnlyState != other.conversationReadOnlyState) return false
if (lobbyState != other.lobbyState) return false if (lobbyState != other.lobbyState) return false
if (lobbyTimer != other.lobbyTimer) return false if (lobbyTimer != other.lobbyTimer) return false
if (canStartCall != other.canStartCall) return false
if (lastReadMessageId != other.lastReadMessageId) return false if (lastReadMessageId != other.lastReadMessageId) return false
if (changing != other.changing) return false if (changing != other.changing) return false
@ -144,6 +147,7 @@ fun ConversationEntity.toConversation(): Conversation {
conversation.conversationReadOnlyState = this.conversationReadOnlyState conversation.conversationReadOnlyState = this.conversationReadOnlyState
conversation.lobbyState = this.lobbyState conversation.lobbyState = this.lobbyState
conversation.lobbyTimer = this.lobbyTimer conversation.lobbyTimer = this.lobbyTimer
conversation.canStartCall = this.canStartCall
conversation.lastReadMessageId = this.lastReadMessageId conversation.lastReadMessageId = this.lastReadMessageId
conversation.changing = this.changing conversation.changing = this.changing
@ -174,6 +178,7 @@ fun Conversation.toConversationEntity(): ConversationEntity {
conversationEntity.lobbyState = this.lobbyState conversationEntity.lobbyState = this.lobbyState
conversationEntity.lobbyTimer = this.lobbyTimer conversationEntity.lobbyTimer = this.lobbyTimer
conversationEntity.lastReadMessageId = this.lastReadMessageId conversationEntity.lastReadMessageId = this.lastReadMessageId
conversationEntity.canStartCall = this.canStartCall
conversationEntity.type = this.type conversationEntity.type = this.type
conversationEntity.changing = this.changing conversationEntity.changing = this.changing