mirror of
https://github.com/vector-im/riotX-android
synced 2025-10-06 00:02:48 +02:00
Do not show edition from other users
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user