2019-01-18 10:12:08 +00:00
|
|
|
/*
|
2019-01-25 13:04:59 +00:00
|
|
|
* Copyright 2019 New Vector Ltd
|
2019-01-18 10:12:08 +00:00
|
|
|
*
|
2019-01-25 13:04:59 +00:00
|
|
|
* 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
|
2019-01-18 10:12:08 +00:00
|
|
|
*
|
2019-01-25 13:04:59 +00:00
|
|
|
* 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.
|
2019-01-18 10:12:08 +00:00
|
|
|
*/
|
|
|
|
|
2018-10-12 14:50:54 +00:00
|
|
|
package im.vector.matrix.android.internal.database.model
|
|
|
|
|
2018-10-15 17:42:13 +00:00
|
|
|
import io.realm.RealmObject
|
|
|
|
import io.realm.RealmResults
|
2019-01-31 19:40:32 +00:00
|
|
|
import io.realm.annotations.Index
|
2018-10-15 17:42:13 +00:00
|
|
|
import io.realm.annotations.LinkingObjects
|
2018-12-17 17:25:02 +00:00
|
|
|
import io.realm.annotations.PrimaryKey
|
|
|
|
import java.util.*
|
2018-10-15 17:42:13 +00:00
|
|
|
|
2018-12-17 17:25:02 +00:00
|
|
|
internal open class EventEntity(@PrimaryKey var localId: String = UUID.randomUUID().toString(),
|
|
|
|
var eventId: String = "",
|
2019-01-03 16:10:02 +00:00
|
|
|
var roomId: String = "",
|
2018-11-13 18:17:59 +00:00
|
|
|
var type: String = "",
|
2018-12-18 11:13:46 +00:00
|
|
|
var content: String? = null,
|
2018-11-13 18:17:59 +00:00
|
|
|
var prevContent: String? = null,
|
2019-01-31 19:40:32 +00:00
|
|
|
@Index var stateKey: String? = null,
|
2018-11-13 18:17:59 +00:00
|
|
|
var originServerTs: Long? = null,
|
|
|
|
var sender: String? = null,
|
|
|
|
var age: Long? = 0,
|
|
|
|
var redacts: String? = null,
|
2018-11-15 18:00:15 +00:00
|
|
|
var stateIndex: Int = 0,
|
2018-11-27 21:42:46 +00:00
|
|
|
var displayIndex: Int = 0,
|
|
|
|
var isUnlinked: Boolean = false
|
2018-10-15 17:42:13 +00:00
|
|
|
) : RealmObject() {
|
|
|
|
|
2018-11-29 17:35:24 +00:00
|
|
|
enum class LinkFilterMode {
|
|
|
|
LINKED_ONLY,
|
|
|
|
UNLINKED_ONLY,
|
|
|
|
BOTH
|
|
|
|
}
|
|
|
|
|
2019-01-03 16:10:02 +00:00
|
|
|
companion object
|
2018-10-16 13:52:30 +00:00
|
|
|
|
2018-10-15 17:42:13 +00:00
|
|
|
@LinkingObjects("events")
|
|
|
|
val chunk: RealmResults<ChunkEntity>? = null
|
|
|
|
|
2018-11-22 10:20:50 +00:00
|
|
|
@LinkingObjects("untimelinedStateEvents")
|
|
|
|
val room: RealmResults<RoomEntity>? = null
|
|
|
|
|
2018-10-12 14:50:54 +00:00
|
|
|
}
|