Creating classes to save aggregated summary of a live location share

This commit is contained in:
Maxime NATUREL 2022-04-27 17:16:06 +02:00
parent 3d190bb2ac
commit 10aa753231
2 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,32 @@
/*
* Copyright (c) 2022 New Vector Ltd
*
* 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.api.session.room.model.livelocation
import org.matrix.android.sdk.api.session.room.model.message.LocationInfo
/**
* Aggregation info concerning a live location share.
*/
data class LiveLocationAggregatedSummary(
/**
* Event id of the event that started the live.
*/
val eventId: String,
val isLive: Boolean,
val endOfLiveTimestampAsMilliseconds: Long,
val lastLocation: LocationInfo? = null
)

View File

@ -0,0 +1,37 @@
/*
* Copyright (c) 2022 New Vector Ltd
*
* 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.livelocation
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
/**
* Aggregation info concerning a live location share.
*/
class LiveLocationAggregatedSummaryEntity(
/**
* Event id of the event that started the live.
*/
@PrimaryKey
var eventId: String = "",
var isLive: Boolean? = null,
val endOfLiveTimestampAsMilliseconds: Long? = null,
val lastLocation: String? = null
) : RealmObject()