Skip to content

Commit

Permalink
Send to-device event list, not wrapper, to engine (#283)
Browse files Browse the repository at this point in the history
* Send to-device event list, not wrapper, to engine

As of matrix-org/matrix-rust-sdk@a443e7277, the JSON-encoded
`toDeviceEvents` passed to OlmMachine.receiveSyncChanges must be the
list of events themselves, instead of a wrapper object that contains the
event list.

Signed-off-by: Andrew Ferrazzutti <[email protected]>

* Fix docs

Signed-off-by: Andrew Ferrazzutti <[email protected]>
  • Loading branch information
AndrewFerr authored Dec 7, 2022
1 parent 6deaf0e commit a4d9b03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/e2ee/CryptoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class CryptoClient {

/**
* Updates the client's sync-related data.
* @param {IToDeviceMessage<IOlmEncrypted>} toDeviceMessages The to-device messages received.
* @param {Array.<IToDeviceMessage<IOlmEncrypted>>} toDeviceMessages The to-device messages received.
* @param {OTKCounts} otkCounts The current OTK counts.
* @param {OTKAlgorithm[]} unusedFallbackKeyAlgs The unused fallback key algorithms.
* @param {string[]} changedDeviceLists The user IDs which had device list changes.
Expand All @@ -157,7 +157,7 @@ export class CryptoClient {
changedDeviceLists: string[],
leftDeviceLists: string[],
): Promise<void> {
const deviceMessages = JSON.stringify({ events: toDeviceMessages });
const deviceMessages = JSON.stringify(toDeviceMessages);
const deviceLists = new DeviceLists(
changedDeviceLists.map(u => new UserId(u)),
leftDeviceLists.map(u => new UserId(u)));
Expand Down

0 comments on commit a4d9b03

Please sign in to comment.