InternalMark all tracked users' device lists as dirty.
This method will cause additional /keys/query requests on the server, so should be used only
when the client has desynced tracking device list deltas from the server.
In MSC4186: Simplified Sliding Sync, this can happen when the server expires the connection.
Called by the /sync loop whenever an m.room.encryption event is received.
This is called before RoomStateEvents are emitted for any of the events in the /sync response (even if the other events technically happened first). This works around a problem if the client uses a RoomStateEvent (typically a membership event) as a trigger to send a message in a new room (or one where encryption has been newly enabled): that would otherwise leave the crypto layer confused because it expects crypto to be set up, but it has not yet been.
in which the event was received
encryption event to be processed
Called by the /sync loop after each /sync response is processed.
Used to complete batch processing, or to initiate background processes
information about the completed sync.
Called by the sync loop once per sync response, with the parts of the response which are relevant to encryption: to-device messages, device list changes, one-time key counts and unused fallback key types.
All of this data must be passed together, in a single call per sync response, because the OlmMachine
interprets it as the complete E2EE state from a sync response. In particular, per the sync v2 specification,
an absent device_one_time_keys_count means that there are no one-time keys on the server, so calling this
without the counts from the response would trigger a spurious one-time key upload. (Sliding sync responses
omit the count when it is unchanged; SyncCryptoChanges.useMsc4186 selects that interpretation.)
This must be called before the room events in the sync response are processed, so that any room keys received in to-device messages are available when decrypting room events.
the E2EE-relevant parts of the sync response
A list of processed to-device messages. This will not map 1:1 to the input list, as some messages may be invalid or fail to decrypt, and so will be omitted from the output list.
The methods which crypto implementations should expose to the Sync api