Adding PollHistoryStatusEntity

This commit is contained in:
Maxime NATUREL 2023-01-16 14:57:51 +01:00
parent c7f6ece825
commit 1ab6faf2d2
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,69 @@
/*
* Copyright (c) 2023 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.matrix.android.sdk.internal.database.model
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
/**
* Keeps track of the loading process of the poll history.
*/
internal open class PollHistoryStatusEntity(
/**
* The related room id.
*/
@PrimaryKey
var roomId: String = "",
/**
* Timestamp of the in progress poll sync target in backward direction in milliseconds.
*/
var currentTimestampTargetBackwardMs: Long? = null,
/**
* Timestamp of the last completed poll sync target in backward direction in milliseconds.
*/
var lastTimestampTargetBackwardMs: Long? = null,
/**
* Indicate whether all polls in a room have been synced for the current timestamp target in backward direction.
*/
var currentTimestampTargetBackwardReached: Boolean = false,
/**
* Indicate whether all polls in a room have been synced in backward direction.
*/
var isEndOfPollsBackward: Boolean = false,
/**
* Indicate whether at least one poll sync has been fully completed backward for the given room.
*/
var hasCompletedASyncBackward: Boolean = false,
/**
* Token of the end of the last synced chunk in backward direction.
*/
var tokenEndBackward: String? = null,
/**
* Token of the start of the last synced chunk in forward direction.
*/
var tokenStartForward: String? = null,
) : RealmObject() {
companion object
}

View file

@ -73,6 +73,7 @@ import org.matrix.android.sdk.internal.database.model.threads.ThreadSummaryEntit
UserPresenceEntity::class, UserPresenceEntity::class,
ThreadSummaryEntity::class, ThreadSummaryEntity::class,
ThreadListPageEntity::class, ThreadListPageEntity::class,
PollHistoryStatusEntity::class,
] ]
) )
internal class SessionRealmModule internal class SessionRealmModule