From f91f662c75128ec6bc66d7b1d8520d894f34f979 Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 5 Aug 2021 12:10:45 +0000 Subject: [PATCH] chore: update to matrix_sdk_lite 0.4.1 --- lib/encryption/olm_manager.dart | 3 +-- lib/src/database/hive_database.dart | 15 +++++++-------- pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/encryption/olm_manager.dart b/lib/encryption/olm_manager.dart index a91599af..ca9af24a 100644 --- a/lib/encryption/olm_manager.dart +++ b/lib/encryption/olm_manager.dart @@ -264,8 +264,7 @@ class OlmManager { // and generate and upload more if not. // If the server did not send us a count, assume it is 0 - final keyCount = - countJson?.tryGet('signed_curve25519', TryGet.optional) ?? 0; + final keyCount = countJson?.tryGet('signed_curve25519') ?? 0; // If the server does not support fallback keys, it will not tell us about them. // If the server supports them but has no key, upload a new one. diff --git a/lib/src/database/hive_database.dart b/lib/src/database/hive_database.dart index 2d1ff83a..d0832e2e 100644 --- a/lib/src/database/hive_database.dart +++ b/lib/src/database/hive_database.dart @@ -778,12 +778,11 @@ class FamedlySdkHiveDatabase extends DatabaseApi { : null; // calculate the status - final newStatus = - eventUpdate.content.tryGet('status', TryGet.optional) ?? - eventUpdate.content - .tryGetMap('unsigned', TryGet.optional) - ?.tryGet(messageSendingStatusKey, TryGet.optional) ?? - 2; + final newStatus = eventUpdate.content.tryGet('status') ?? + eventUpdate.content + .tryGetMap('unsigned') + ?.tryGet(messageSendingStatusKey) ?? + 2; final status = newStatus == -1 || prevEvent?.status == null ? newStatus @@ -797,8 +796,8 @@ class FamedlySdkHiveDatabase extends DatabaseApi { // In case this event has sent from this account we have a transaction ID final transactionId = eventUpdate.content - .tryGetMap('unsigned', TryGet.optional) - ?.tryGet('transaction_id', TryGet.optional); + .tryGetMap('unsigned') + ?.tryGet('transaction_id'); await _eventsBox.put(MultiKey(eventUpdate.roomID, eventId).toString(), eventUpdate.content); diff --git a/pubspec.yaml b/pubspec.yaml index 5a6ea7d5..642e3ae6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: crypto: ^3.0.0 base58check: ^2.0.0 olm: ^2.0.0 - matrix_api_lite: ^0.4.0 + matrix_api_lite: ^0.4.1 hive: ^2.0.4 ffi: ^1.0.0 js: ^0.6.3