mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
Merge pull request #5890 from vector-im/feature/bma/another_cleanup
This is not necessary to map the EventId
This commit is contained in:
commit
2ff6604555
5 changed files with 2 additions and 7 deletions
1
changelog.d/5890.sdk
Normal file
1
changelog.d/5890.sdk
Normal file
|
@ -0,0 +1 @@
|
|||
Remove unecessary field `eventId` from `EventAnnotationsSummary` and `ReferencesAggregatedSummary`
|
|
@ -16,7 +16,6 @@
|
|||
package org.matrix.android.sdk.api.session.room.model
|
||||
|
||||
data class EventAnnotationsSummary(
|
||||
val eventId: String,
|
||||
val reactionsSummary: List<ReactionAggregatedSummary> = emptyList(),
|
||||
val editSummary: EditAggregatedSummary? = null,
|
||||
val pollResponseSummary: PollResponseAggregatedSummary? = null,
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.matrix.android.sdk.api.session.events.model.Content
|
|||
* of all events that are referencing the 'eventId' event via the RelationType.REFERENCE
|
||||
*/
|
||||
data class ReferencesAggregatedSummary(
|
||||
val eventId: String,
|
||||
val content: Content?,
|
||||
val sourceEvents: List<String>,
|
||||
val localEchos: List<String>
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.matrix.android.sdk.internal.database.model.EventAnnotationsSummaryEnt
|
|||
internal object EventAnnotationsSummaryMapper {
|
||||
fun map(annotationsSummary: EventAnnotationsSummaryEntity): EventAnnotationsSummary {
|
||||
return EventAnnotationsSummary(
|
||||
eventId = annotationsSummary.eventId,
|
||||
reactionsSummary = annotationsSummary.reactionsSummary.toList().map {
|
||||
ReactionAggregatedSummary(
|
||||
it.key,
|
||||
|
@ -50,7 +49,6 @@ internal object EventAnnotationsSummaryMapper {
|
|||
},
|
||||
referencesAggregatedSummary = annotationsSummary.referencesSummaryEntity?.let {
|
||||
ReferencesAggregatedSummary(
|
||||
it.eventId,
|
||||
ContentMapper.map(it.content),
|
||||
it.sourceEvents.toList(),
|
||||
it.sourceLocalEcho.toList()
|
||||
|
|
|
@ -98,9 +98,7 @@ internal class UIEchoManager(private val listener: Listener) {
|
|||
val relatedEventID = timelineEvent.eventId
|
||||
val contents = inMemoryReactions[relatedEventID] ?: return timelineEvent
|
||||
|
||||
var existingAnnotationSummary = timelineEvent.annotations ?: EventAnnotationsSummary(
|
||||
relatedEventID
|
||||
)
|
||||
var existingAnnotationSummary = timelineEvent.annotations ?: EventAnnotationsSummary()
|
||||
val updateReactions = existingAnnotationSummary.reactionsSummary.toMutableList()
|
||||
|
||||
contents.forEach { uiEchoReaction ->
|
||||
|
|
Loading…
Reference in a new issue