mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Do not show edition from other users
This commit is contained in:
parent
f5fad8a082
commit
c33af6de6a
2 changed files with 9 additions and 3 deletions
|
@ -92,6 +92,9 @@ interface RelationService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the edit history of the given event
|
* Get the edit history of the given event
|
||||||
|
* The return list will contain the original event and all the editions of this event, done by the
|
||||||
|
* same sender, sorted in the reverse order (so the original event is the latest element, and the
|
||||||
|
* latest edition is the first element of the list)
|
||||||
*/
|
*/
|
||||||
suspend fun fetchEditHistory(eventId: String): List<Event>
|
suspend fun fetchEditHistory(eventId: String): List<Event>
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,11 @@ internal class DefaultFetchEditHistoryTask @Inject constructor(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val events = response.chunks.toMutableList()
|
// Filter out edition form other users
|
||||||
response.originalEvent?.let { events.add(it) }
|
val originalSenderId = response.originalEvent?.senderId
|
||||||
return events
|
val events = response.chunks.filter {
|
||||||
|
it.senderId == originalSenderId
|
||||||
|
}
|
||||||
|
return events + listOfNotNull(response.originalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue