Fix redact events

This commit is contained in:
Sorunome 2020-06-05 13:32:58 +02:00
parent f7e9bbafac
commit 860051da0e
No known key found for this signature in database
GPG key ID: B19471D07FC9BE9C

View file

@ -24,6 +24,7 @@ class MatrixEvent extends StrippedStateEvent {
DateTime originServerTs; DateTime originServerTs;
Map<String, dynamic> unsigned; Map<String, dynamic> unsigned;
Map<String, dynamic> prevContent; Map<String, dynamic> prevContent;
String redacts;
MatrixEvent(); MatrixEvent();
@ -43,6 +44,7 @@ class MatrixEvent extends StrippedStateEvent {
prevContent = json['prev_content'] != null prevContent = json['prev_content'] != null
? Map<String, dynamic>.from(json['prev_content']) ? Map<String, dynamic>.from(json['prev_content'])
: null; : null;
redacts = json['redacts'];
} }
@override @override
@ -62,6 +64,9 @@ class MatrixEvent extends StrippedStateEvent {
if (data['state_key'] == null) { if (data['state_key'] == null) {
data.remove('state_key'); data.remove('state_key');
} }
if (redacts != null) {
data['redacts'] = redacts;
}
return data; return data;
} }
} }