Fix storing of event status
This commit is contained in:
parent
a11a0b5925
commit
bbd5749aec
|
@ -6,6 +6,7 @@ import 'package:famedlysdk/matrix_api.dart' as api;
|
||||||
import 'package:olm/olm.dart' as olm;
|
import 'package:olm/olm.dart' as olm;
|
||||||
|
|
||||||
import '../../matrix_api.dart';
|
import '../../matrix_api.dart';
|
||||||
|
import '../room.dart';
|
||||||
|
|
||||||
part 'database.g.dart';
|
part 'database.g.dart';
|
||||||
|
|
||||||
|
@ -357,6 +358,10 @@ class Database extends _$Database {
|
||||||
if (type == 'timeline' || type == 'history') {
|
if (type == 'timeline' || type == 'history') {
|
||||||
// calculate the status
|
// calculate the status
|
||||||
var status = 2;
|
var status = 2;
|
||||||
|
if (eventContent['unsigned'] is Map<String, dynamic> &&
|
||||||
|
eventContent['unsigned'][MessageSendingStatusKey] is num) {
|
||||||
|
status = eventContent['unsigned'][MessageSendingStatusKey];
|
||||||
|
}
|
||||||
if (eventContent['status'] is num) status = eventContent['status'];
|
if (eventContent['status'] is num) status = eventContent['status'];
|
||||||
if ((status == 1 || status == -1) &&
|
if ((status == 1 || status == -1) &&
|
||||||
eventContent['unsigned'] is Map<String, dynamic> &&
|
eventContent['unsigned'] is Map<String, dynamic> &&
|
||||||
|
|
Loading…
Reference in a new issue