mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 18:05:36 +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
|
package org.matrix.android.sdk.api.session.room.model
|
||||||
|
|
||||||
data class EventAnnotationsSummary(
|
data class EventAnnotationsSummary(
|
||||||
val eventId: String,
|
|
||||||
val reactionsSummary: List<ReactionAggregatedSummary> = emptyList(),
|
val reactionsSummary: List<ReactionAggregatedSummary> = emptyList(),
|
||||||
val editSummary: EditAggregatedSummary? = null,
|
val editSummary: EditAggregatedSummary? = null,
|
||||||
val pollResponseSummary: PollResponseAggregatedSummary? = 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
|
* of all events that are referencing the 'eventId' event via the RelationType.REFERENCE
|
||||||
*/
|
*/
|
||||||
data class ReferencesAggregatedSummary(
|
data class ReferencesAggregatedSummary(
|
||||||
val eventId: String,
|
|
||||||
val content: Content?,
|
val content: Content?,
|
||||||
val sourceEvents: List<String>,
|
val sourceEvents: List<String>,
|
||||||
val localEchos: List<String>
|
val localEchos: List<String>
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.matrix.android.sdk.internal.database.model.EventAnnotationsSummaryEnt
|
||||||
internal object EventAnnotationsSummaryMapper {
|
internal object EventAnnotationsSummaryMapper {
|
||||||
fun map(annotationsSummary: EventAnnotationsSummaryEntity): EventAnnotationsSummary {
|
fun map(annotationsSummary: EventAnnotationsSummaryEntity): EventAnnotationsSummary {
|
||||||
return EventAnnotationsSummary(
|
return EventAnnotationsSummary(
|
||||||
eventId = annotationsSummary.eventId,
|
|
||||||
reactionsSummary = annotationsSummary.reactionsSummary.toList().map {
|
reactionsSummary = annotationsSummary.reactionsSummary.toList().map {
|
||||||
ReactionAggregatedSummary(
|
ReactionAggregatedSummary(
|
||||||
it.key,
|
it.key,
|
||||||
|
@ -50,7 +49,6 @@ internal object EventAnnotationsSummaryMapper {
|
||||||
},
|
},
|
||||||
referencesAggregatedSummary = annotationsSummary.referencesSummaryEntity?.let {
|
referencesAggregatedSummary = annotationsSummary.referencesSummaryEntity?.let {
|
||||||
ReferencesAggregatedSummary(
|
ReferencesAggregatedSummary(
|
||||||
it.eventId,
|
|
||||||
ContentMapper.map(it.content),
|
ContentMapper.map(it.content),
|
||||||
it.sourceEvents.toList(),
|
it.sourceEvents.toList(),
|
||||||
it.sourceLocalEcho.toList()
|
it.sourceLocalEcho.toList()
|
||||||
|
|
|
@ -98,9 +98,7 @@ internal class UIEchoManager(private val listener: Listener) {
|
||||||
val relatedEventID = timelineEvent.eventId
|
val relatedEventID = timelineEvent.eventId
|
||||||
val contents = inMemoryReactions[relatedEventID] ?: return timelineEvent
|
val contents = inMemoryReactions[relatedEventID] ?: return timelineEvent
|
||||||
|
|
||||||
var existingAnnotationSummary = timelineEvent.annotations ?: EventAnnotationsSummary(
|
var existingAnnotationSummary = timelineEvent.annotations ?: EventAnnotationsSummary()
|
||||||
relatedEventID
|
|
||||||
)
|
|
||||||
val updateReactions = existingAnnotationSummary.reactionsSummary.toMutableList()
|
val updateReactions = existingAnnotationSummary.reactionsSummary.toMutableList()
|
||||||
|
|
||||||
contents.forEach { uiEchoReaction ->
|
contents.forEach { uiEchoReaction ->
|
||||||
|
|
Loading…
Reference in a new issue