mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 06:53:32 -04:00
If we have a device whose Curve25519 key we don't know, then self-evidently we can't have any active Olm sessions with that device. Currently, we return an `EventError::MissingSenderKey` in this case, but (a) the definition of that error doesn't match this situation, and (b) it complicates handling in methods that call `DeviceData::encrypt` (currently only `DeviceData::maybe_encrypt_room_key`, but I want to add a second). Other than `DeviceData::encrypt`, the only place where `get_most_recent_session` is called is `mark_device_as_wedged`. In that case, we have just looked up the device by its Curve25519 key, so we know it must have one. We can therefore be reasonably certain that this change is a no-op.