From bbd5749aec7288a412a40ef39c9c0e65a3d91179 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 4 Aug 2020 15:08:25 +0200 Subject: [PATCH] Fix storing of event status --- lib/src/database/database.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/database/database.dart b/lib/src/database/database.dart index adb9fc6..6caec77 100644 --- a/lib/src/database/database.dart +++ b/lib/src/database/database.dart @@ -6,6 +6,7 @@ import 'package:famedlysdk/matrix_api.dart' as api; import 'package:olm/olm.dart' as olm; import '../../matrix_api.dart'; +import '../room.dart'; part 'database.g.dart'; @@ -357,6 +358,10 @@ class Database extends _$Database { if (type == 'timeline' || type == 'history') { // calculate the status var status = 2; + if (eventContent['unsigned'] is Map && + eventContent['unsigned'][MessageSendingStatusKey] is num) { + status = eventContent['unsigned'][MessageSendingStatusKey]; + } if (eventContent['status'] is num) status = eventContent['status']; if ((status == 1 || status == -1) && eventContent['unsigned'] is Map &&