Merge branch 'Event-fix-default-status' into 'master'
[Event] Set default status to '2' if there is no status given. See merge request famedly/famedlysdk!16
This commit is contained in:
commit
7e753d4d0b
|
@ -142,7 +142,7 @@ class Event {
|
||||||
ChatTime(jsonObj["origin_server_ts"]),
|
ChatTime(jsonObj["origin_server_ts"]),
|
||||||
stateKey: User(jsonObj["state_key"]),
|
stateKey: User(jsonObj["state_key"]),
|
||||||
environment: jsonObj["type"],
|
environment: jsonObj["type"],
|
||||||
status: jsonObj["status"],
|
status: jsonObj["status"] ?? 2,
|
||||||
content: content,
|
content: content,
|
||||||
room: room,
|
room: room,
|
||||||
);
|
);
|
||||||
|
|
|
@ -35,7 +35,6 @@ void main() {
|
||||||
final String empty = "";
|
final String empty = "";
|
||||||
final String membership = "join";
|
final String membership = "join";
|
||||||
final String type = "m.room.message";
|
final String type = "m.room.message";
|
||||||
final int status = 2;
|
|
||||||
final String msgtype = "m.text";
|
final String msgtype = "m.text";
|
||||||
final String body = "Hello World";
|
final String body = "Hello World";
|
||||||
final String formatted_body = "<b>Hello</b> World";
|
final String formatted_body = "<b>Hello</b> World";
|
||||||
|
@ -52,7 +51,6 @@ void main() {
|
||||||
"origin_server_ts": timestamp,
|
"origin_server_ts": timestamp,
|
||||||
"state_key": empty,
|
"state_key": empty,
|
||||||
"type": type,
|
"type": type,
|
||||||
"status": status,
|
|
||||||
"content_json": contentJson,
|
"content_json": contentJson,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,7 +61,7 @@ void main() {
|
||||||
expect(event.sender.displayName, senderDisplayname);
|
expect(event.sender.displayName, senderDisplayname);
|
||||||
expect(event.sender.avatarUrl.mxc, empty);
|
expect(event.sender.avatarUrl.mxc, empty);
|
||||||
expect(event.sender.membership, membership);
|
expect(event.sender.membership, membership);
|
||||||
expect(event.status, status);
|
expect(event.status, 2);
|
||||||
expect(event.text, body);
|
expect(event.text, body);
|
||||||
expect(event.formattedText, formatted_body);
|
expect(event.formattedText, formatted_body);
|
||||||
expect(event.getBody(), body);
|
expect(event.getBody(), body);
|
||||||
|
|
Loading…
Reference in a new issue