Merge pull request #629 from vector-im/feature/fix_malformed_event_bug

Fix / event mapper persist the clear type in type
This commit is contained in:
Benoit Marty 2019-10-22 14:47:08 +02:00 committed by GitHub
commit 00d1a2c380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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()) {

View File

@ -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