Clean code

This commit is contained in:
ganfra 2020-02-21 14:04:33 +01:00 committed by Benoit Marty
parent 133d8d7f14
commit 8b0305c91d
3 changed files with 1 additions and 4 deletions

View File

@ -63,5 +63,3 @@ data class RoomSummary constructor(
const val NOT_IN_BREADCRUMBS = -1 const val NOT_IN_BREADCRUMBS = -1
} }
} }

View File

@ -32,7 +32,7 @@ internal object EventMapper {
val uds = if (event.unsignedData == null) null val uds = if (event.unsignedData == null) null
else MoshiProvider.providesMoshi().adapter(UnsignedData::class.java).toJson(event.unsignedData) else MoshiProvider.providesMoshi().adapter(UnsignedData::class.java).toJson(event.unsignedData)
val eventEntity = EventEntity() val eventEntity = EventEntity()
//TODO change this as we shouldn't use event everywhere // TODO change this as we shouldn't use event everywhere
eventEntity.eventId = event.eventId ?: "$roomId-${System.currentTimeMillis()}-${event.hashCode()}" eventEntity.eventId = event.eventId ?: "$roomId-${System.currentTimeMillis()}-${event.hashCode()}"
eventEntity.roomId = event.roomId ?: roomId eventEntity.roomId = event.roomId ?: roomId
eventEntity.content = ContentMapper.map(event.content) eventEntity.content = ContentMapper.map(event.content)

View File

@ -22,7 +22,6 @@ import im.vector.matrix.android.internal.crypto.algorithms.olm.OlmDecryptionResu
import im.vector.matrix.android.internal.di.MoshiProvider import im.vector.matrix.android.internal.di.MoshiProvider
import io.realm.RealmObject import io.realm.RealmObject
import io.realm.annotations.Index import io.realm.annotations.Index
import io.realm.annotations.PrimaryKey
internal open class EventEntity(@Index var eventId: String = "", internal open class EventEntity(@Index var eventId: String = "",
@Index var roomId: String = "", @Index var roomId: String = "",