From 0a6a81380478577a80a6326ad64d9b472c1ed549 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 7 Nov 2022 11:09:20 +0100 Subject: [PATCH] refactor: Get rid of unnecessary type cast --- lib/encryption/encryption.dart | 2 +- lib/encryption/olm_manager.dart | 2 +- lib/src/client.dart | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) 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);