mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-31 11:24:58 +01:00
Branch back relation summaries
This commit is contained in:
parent
79a704d240
commit
c503445092
@ -18,6 +18,7 @@ package im.vector.matrix.android.internal.database.query
|
||||
|
||||
import im.vector.matrix.android.internal.database.model.EventAnnotationsSummaryEntity
|
||||
import im.vector.matrix.android.internal.database.model.EventAnnotationsSummaryEntityFields
|
||||
import im.vector.matrix.android.internal.database.model.TimelineEventEntity
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmQuery
|
||||
import io.realm.kotlin.where
|
||||
@ -39,5 +40,9 @@ internal fun EventAnnotationsSummaryEntity.Companion.whereInRoom(realm: Realm, r
|
||||
|
||||
internal fun EventAnnotationsSummaryEntity.Companion.create(realm: Realm, eventId: String): EventAnnotationsSummaryEntity {
|
||||
val obj = realm.createObject(EventAnnotationsSummaryEntity::class.java, eventId)
|
||||
//Denormalization
|
||||
TimelineEventEntity.where(realm, eventId = eventId).findFirst()?.let {
|
||||
it.annotations = obj
|
||||
}
|
||||
return obj
|
||||
}
|
@ -86,6 +86,13 @@ internal class DefaultEventRelationsAggregationTask @Inject constructor(private
|
||||
}
|
||||
}
|
||||
|
||||
EventAnnotationsSummaryEntity.where(realm, event.eventId ?: "").findFirst()?.let {
|
||||
TimelineEventEntity.where(realm,eventId = event.eventId ?: "").findFirst()?.let { tet ->
|
||||
tet.annotations = it
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
EventType.REDACTION -> {
|
||||
val eventToPrune = event.redacts?.let { EventEntity.where(realm, eventId = it).findFirst() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user