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