Rename isLive field to isActive

This commit is contained in:
Maxime NATUREL 2022-04-29 13:44:03 +02:00
parent f9220e4185
commit 3460df7ac8
5 changed files with 7 additions and 7 deletions

View File

@ -27,7 +27,7 @@ data class LiveLocationAggregatedSummary(
*/
val eventId: String,
val roomId: String,
val isLive: Boolean?,
val isActive: Boolean?,
val endOfLiveTimestampAsMilliseconds: Long?,
val lastLocationContent: MessageLiveLocationContent?,
)

View File

@ -28,7 +28,7 @@ internal object LiveLocationAggregatedSummaryMapper {
return LiveLocationAggregatedSummary(
eventId = entity.eventId,
roomId = entity.roomId,
isLive = entity.isLive,
isActive = entity.isActive,
endOfLiveTimestampAsMilliseconds = entity.endOfLiveTimestampAsMilliseconds,
lastLocationContent = ContentMapper.map(entity.lastLocationContent).toModel<MessageLiveLocationContent>()
)
@ -38,7 +38,7 @@ internal object LiveLocationAggregatedSummaryMapper {
return LiveLocationAggregatedSummaryEntity(
eventId = model.eventId,
roomId = model.roomId,
isLive = model.isLive,
isActive = model.isActive,
endOfLiveTimestampAsMilliseconds = model.endOfLiveTimestampAsMilliseconds,
lastLocationContent = ContentMapper.map(model.lastLocationContent.toContent())
)

View File

@ -33,8 +33,8 @@ internal class MigrateSessionTo027(realm: DynamicRealm) : RealmMigrator(realm, 2
?: realm.schema.create("LiveLocationAggregatedSummaryEntity")
.addField(LiveLocationAggregatedSummaryEntityFields.EVENT_ID, String::class.java, FieldAttribute.REQUIRED)
.addField(LiveLocationAggregatedSummaryEntityFields.ROOM_ID, String::class.java, FieldAttribute.REQUIRED)
.addField(LiveLocationAggregatedSummaryEntityFields.IS_LIVE, Boolean::class.java)
.setNullable(LiveLocationAggregatedSummaryEntityFields.IS_LIVE, true)
.addField(LiveLocationAggregatedSummaryEntityFields.IS_ACTIVE, Boolean::class.java)
.setNullable(LiveLocationAggregatedSummaryEntityFields.IS_ACTIVE, true)
.addField(LiveLocationAggregatedSummaryEntityFields.END_OF_LIVE_TIMESTAMP_AS_MILLISECONDS, Long::class.java)
.setNullable(LiveLocationAggregatedSummaryEntityFields.END_OF_LIVE_TIMESTAMP_AS_MILLISECONDS, true)
.addField(LiveLocationAggregatedSummaryEntityFields.LAST_LOCATION_CONTENT, String::class.java)

View File

@ -31,7 +31,7 @@ internal open class LiveLocationAggregatedSummaryEntity(
var roomId: String = "",
var isLive: Boolean? = null,
var isActive: Boolean? = null,
var endOfLiveTimestampAsMilliseconds: Long? = null,

View File

@ -55,7 +55,7 @@ internal class DefaultLiveLocationAggregationProcessor @Inject constructor() : L
)
aggregatedSummary.endOfLiveTimestampAsMilliseconds = content.getBestTimestampAsMilliseconds()?.let { it + (content.timeout ?: 0) }
aggregatedSummary.isLive = content.isLive
aggregatedSummary.isActive = content.isLive
}
override fun handleLiveLocation(realm: Realm, event: Event, content: MessageLiveLocationContent, roomId: String, isLocalEcho: Boolean) {