diff --git a/lib/encryption/encryption.dart b/lib/encryption/encryption.dart index edc7c87a..b852363a 100644 --- a/lib/encryption/encryption.dart +++ b/lib/encryption/encryption.dart @@ -399,7 +399,7 @@ class Encryption { return encryptedPayload; } - Future> encryptToDeviceMessage( + Future>>> encryptToDeviceMessage( List deviceKeys, String type, Map payload) async { diff --git a/lib/encryption/olm_manager.dart b/lib/encryption/olm_manager.dart index 8dafb133..4fb7a0bd 100644 --- a/lib/encryption/olm_manager.dart +++ b/lib/encryption/olm_manager.dart @@ -631,7 +631,7 @@ class OlmManager { return encryptedBody; } - Future> encryptToDeviceMessage( + Future>>> encryptToDeviceMessage( List deviceKeys, String type, Map payload) async { diff --git a/lib/src/client.dart b/lib/src/client.dart index 236862ee..e1be6f8e 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -2617,8 +2617,10 @@ class Client extends MatrixApi { // Send with send-to-device messaging final data = await encryption.encryptToDeviceMessage( - deviceKeys, eventType, message) - as Map>>; + deviceKeys, + eventType, + message, + ); eventType = EventTypes.Encrypted; await sendToDevice( eventType, messageId ?? generateUniqueTransactionId(), data);