From 64b3568d5178b6f3ae1d07e6f88380922afe5569 Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 22 Oct 2019 11:57:11 +0200 Subject: [PATCH] Fix / event mapper persist the clear type in type --- .../android/internal/database/helper/ChunkEntityHelper.kt | 2 +- .../matrix/android/internal/database/mapper/EventMapper.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/helper/ChunkEntityHelper.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/helper/ChunkEntityHelper.kt index 4c65fc1e64..e9ffa140c9 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/helper/ChunkEntityHelper.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/helper/ChunkEntityHelper.kt @@ -124,7 +124,7 @@ internal fun ChunkEntity.add(roomId: String, backwardsDisplayIndex = currentDisplayIndex } var currentStateIndex = lastStateIndex(direction, defaultValue = stateIndexOffset) - if (direction == PaginationDirection.FORWARDS && EventType.isStateEvent(event.getClearType())) { + if (direction == PaginationDirection.FORWARDS && EventType.isStateEvent(event.type)) { currentStateIndex += 1 forwardsStateIndex = currentStateIndex } else if (direction == PaginationDirection.BACKWARDS && timelineEvents.isNotEmpty()) { diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/mapper/EventMapper.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/mapper/EventMapper.kt index daeb7b241f..ed5f04ef75 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/mapper/EventMapper.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/mapper/EventMapper.kt @@ -37,7 +37,7 @@ internal object EventMapper { val resolvedPrevContent = event.prevContent ?: event.unsignedData?.prevContent eventEntity.prevContent = ContentMapper.map(resolvedPrevContent) eventEntity.stateKey = event.stateKey - eventEntity.type = event.getClearType() + eventEntity.type = event.type eventEntity.sender = event.senderId eventEntity.originServerTs = event.originServerTs eventEntity.redacts = event.redacts