From 3460df7ac86b8ed88b3bc686c3785bb7064b7019 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Fri, 29 Apr 2022 13:44:03 +0200 Subject: [PATCH] Rename isLive field to isActive --- .../room/model/livelocation/LiveLocationAggregatedSummary.kt | 2 +- .../database/mapper/LiveLocationAggregatedSummaryMapper.kt | 4 ++-- .../sdk/internal/database/migration/MigrateSessionTo027.kt | 4 ++-- .../model/livelocation/LiveLocationAggregatedSummaryEntity.kt | 2 +- .../livelocation/DefaultLiveLocationAggregationProcessor.kt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/livelocation/LiveLocationAggregatedSummary.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/livelocation/LiveLocationAggregatedSummary.kt index 8b24ab32bc..184ca6e380 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/livelocation/LiveLocationAggregatedSummary.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/livelocation/LiveLocationAggregatedSummary.kt @@ -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?, ) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/LiveLocationAggregatedSummaryMapper.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/LiveLocationAggregatedSummaryMapper.kt index d4f55b92c7..d87dec9689 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/LiveLocationAggregatedSummaryMapper.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/LiveLocationAggregatedSummaryMapper.kt @@ -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() ) @@ -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()) ) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo027.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo027.kt index e4049a59ad..decb4066c5 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo027.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo027.kt @@ -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) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/model/livelocation/LiveLocationAggregatedSummaryEntity.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/model/livelocation/LiveLocationAggregatedSummaryEntity.kt index f198a252b8..e3bd800293 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/model/livelocation/LiveLocationAggregatedSummaryEntity.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/model/livelocation/LiveLocationAggregatedSummaryEntity.kt @@ -31,7 +31,7 @@ internal open class LiveLocationAggregatedSummaryEntity( var roomId: String = "", - var isLive: Boolean? = null, + var isActive: Boolean? = null, var endOfLiveTimestampAsMilliseconds: Long? = null, diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt index 928c2c5f02..1650e98d5b 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt @@ -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) {