[Event] Fix default status

This commit is contained in:
Christian Pauly 2019-08-29 09:12:55 +02:00
parent 91ae18e760
commit c5664bfa71

View file

@ -37,8 +37,10 @@ class Event extends RoomState {
/// 2=RECEIVED
int status;
static const int defaultStatus = 2;
Event(
{this.status = 2,
{this.status = defaultStatus,
dynamic content,
String typeKey,
String eventId,
@ -70,7 +72,7 @@ class Event extends RoomState {
final Map<String, dynamic> prevContent =
RawEvent.getMapFromPayload(jsonPayload['prev_content']);
return Event(
status: jsonPayload['status'] ?? 1,
status: jsonPayload['status'] ?? defaultStatus,
content: content,
typeKey: jsonPayload['type'],
eventId: jsonPayload['event_id'],