mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-16 12:43:01 -04:00
This patch implements `LatestEvent::update_with_send_queue`. It introduces an intermediate type, for the sake of clarity, `LatestEventValuesForLocalEvents`. The difficulty here is to keep a buffer of `LatestEventValue`s requested by the `SendQueue`. Why? Because we want the latest event value, but we only receive `RoomSendQueueUpdate`s, we can't iterate over local events in the `SendQueue` like we do for the `EventCache` to re-compute the latest event if a local event has been cancelled or updated. A particular care must also be applied when a local event is wedged: this local event and all its followings must be marked as wedged too, so that the `LatestEventValue` is `LocalIsWedged`. Same when the local event is unwedged.