mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 03:49:04 +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
|
||||
* 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>
|
||||
|
||||
|
|
|
@ -49,8 +49,11 @@ internal class DefaultFetchEditHistoryTask @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
val events = response.chunks.toMutableList()
|
||||
response.originalEvent?.let { events.add(it) }
|
||||
return events
|
||||
// Filter out edition form other users
|
||||
val originalSenderId = response.originalEvent?.senderId
|
||||
val events = response.chunks.filter {
|
||||
it.senderId == originalSenderId
|
||||
}
|
||||
return events + listOfNotNull(response.originalEvent)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue