Merge branch 'krille/refactor-event-update' into 'main'

refactor: Deprecate eventType in EventUpdate

See merge request famedly/famedlysdk!661
This commit is contained in:
Sorunome 2021-02-26 16:11:57 +00:00
commit 885141968c
11 changed files with 26 additions and 63 deletions

View File

@ -118,8 +118,8 @@ class Encryption {
if (update.type == EventUpdateType.ephemeral) { if (update.type == EventUpdateType.ephemeral) {
return; return;
} }
if (update.eventType.startsWith('m.key.verification.') || if (update.content['type'].startsWith('m.key.verification.') ||
(update.eventType == EventTypes.Message && (update.content['type'] == EventTypes.Message &&
(update.content['content']['msgtype'] is String) && (update.content['content']['msgtype'] is String) &&
update.content['content']['msgtype'] update.content['content']['msgtype']
.startsWith('m.key.verification.'))) { .startsWith('m.key.verification.'))) {
@ -281,7 +281,6 @@ class Encryption {
await client.database?.storeEventUpdate( await client.database?.storeEventUpdate(
client.id, client.id,
EventUpdate( EventUpdate(
eventType: event.type,
content: event.toJson(), content: event.toJson(),
roomID: event.roomId, roomID: event.roomId,
type: updateType, type: updateType,

View File

@ -1274,7 +1274,6 @@ class Client extends MatrixApi {
? (sortAtTheEnd ? room.oldSortOrder : room.newSortOrder) ? (sortAtTheEnd ? room.oldSortOrder : room.newSortOrder)
: 0.0; : 0.0;
var update = EventUpdate( var update = EventUpdate(
eventType: event['type'],
roomID: roomID, roomID: roomID,
type: type, type: type,
content: event, content: event,
@ -1424,11 +1423,11 @@ sort order of ${prevState.sortOrder}. This should never happen...''');
} }
break; break;
case EventUpdateType.accountData: case EventUpdateType.accountData:
room.roomAccountData[eventUpdate.eventType] = room.roomAccountData[eventUpdate.content['type']] =
BasicRoomEvent.fromJson(eventUpdate.content); BasicRoomEvent.fromJson(eventUpdate.content);
break; break;
case EventUpdateType.ephemeral: case EventUpdateType.ephemeral:
room.ephemerals[eventUpdate.eventType] = room.ephemerals[eventUpdate.content['type']] =
BasicRoomEvent.fromJson(eventUpdate.content); BasicRoomEvent.fromJson(eventUpdate.content);
break; break;
case EventUpdateType.history: case EventUpdateType.history:

View File

@ -461,7 +461,7 @@ class Database extends _$Database {
stateKey = eventContent['state_key']; stateKey = eventContent['state_key'];
} }
if (eventUpdate.eventType == api.EventTypes.Redaction) { if (eventUpdate.content['type'] == api.EventTypes.Redaction) {
await redactMessage(clientId, eventUpdate); await redactMessage(clientId, eventUpdate);
} }
@ -556,7 +556,7 @@ class Database extends _$Database {
api.EventTypes.Message, api.EventTypes.Message,
api.EventTypes.Sticker, api.EventTypes.Sticker,
api.EventTypes.Encrypted api.EventTypes.Encrypted
].contains(eventUpdate.eventType))) { ].contains(eventUpdate.content['type']))) {
final now = DateTime.now(); final now = DateTime.now();
await storeRoomState( await storeRoomState(
clientId, clientId,

View File

@ -320,7 +320,6 @@ class Event extends MatrixEvent {
room.client.onEvent.add(EventUpdate( room.client.onEvent.add(EventUpdate(
roomID: room.id, roomID: room.id,
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
eventType: type,
content: { content: {
'event_id': eventId, 'event_id': eventId,
'status': -2, 'status': -2,

View File

@ -1301,7 +1301,6 @@ class Room {
content: content, content: content,
roomID: id, roomID: id,
type: EventUpdateType.state, type: EventUpdateType.state,
eventType: EventTypes.RoomMember,
sortOrder: 0.0), sortOrder: 0.0),
); );
}); });

View File

@ -268,7 +268,7 @@ class Timeline {
: null) ?? : null) ??
2; 2;
// Redaction events are handled as modification for existing events. // Redaction events are handled as modification for existing events.
if (eventUpdate.eventType == EventTypes.Redaction) { if (eventUpdate.content['type'] == EventTypes.Redaction) {
final eventId = _findEvent(event_id: eventUpdate.content['redacts']); final eventId = _findEvent(event_id: eventUpdate.content['redacts']);
if (eventId < events.length) { if (eventId < events.length) {
removeAggregatedEvent(events[eventId]); removeAggregatedEvent(events[eventId]);

View File

@ -36,10 +36,8 @@ class EventUpdate {
/// Most events belong to a room. If not, this equals to eventType. /// Most events belong to a room. If not, this equals to eventType.
final String roomID; final String roomID;
/// See (Matrix Room Events)[https://matrix.org/docs/spec/client_server/r0.4.0.html#room-events] @Deprecated("Use `content['eventType']` instead.")
/// and (Matrix Events)[https://matrix.org/docs/spec/client_server/r0.4.0.html#id89] for more String get eventType => content['type'];
/// informations.
final String eventType;
// The json payload of the content of this event. // The json payload of the content of this event.
final Map<String, dynamic> content; final Map<String, dynamic> content;
@ -47,11 +45,11 @@ class EventUpdate {
// the order where to stort this event // the order where to stort this event
final double sortOrder; final double sortOrder;
EventUpdate( EventUpdate({this.roomID, this.type, this.content, this.sortOrder});
{this.eventType, this.roomID, this.type, this.content, this.sortOrder});
Future<EventUpdate> decrypt(Room room, {bool store = false}) async { Future<EventUpdate> decrypt(Room room, {bool store = false}) async {
if (eventType != EventTypes.Encrypted || !room.client.encryptionEnabled) { if (content['type'] != EventTypes.Encrypted ||
!room.client.encryptionEnabled) {
return this; return this;
} }
try { try {
@ -59,7 +57,6 @@ class EventUpdate {
room.id, Event.fromJson(content, room, sortOrder), room.id, Event.fromJson(content, room, sortOrder),
store: store, updateType: type); store: store, updateType: type);
return EventUpdate( return EventUpdate(
eventType: decrpytedEvent.type,
roomID: roomID, roomID: roomID,
type: type, type: type,
content: decrpytedEvent.toJson(), content: decrpytedEvent.toJson(),

View File

@ -245,55 +245,56 @@ void main() {
expect(eventUpdateList.length, 14); expect(eventUpdateList.length, 14);
expect(eventUpdateList[0].eventType, 'm.room.member'); expect(eventUpdateList[0].content['type'], 'm.room.member');
expect(eventUpdateList[0].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[0].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[0].type, EventUpdateType.state); expect(eventUpdateList[0].type, EventUpdateType.state);
expect(eventUpdateList[1].eventType, 'm.room.canonical_alias'); expect(eventUpdateList[1].content['type'], 'm.room.canonical_alias');
expect(eventUpdateList[1].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[1].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[1].type, EventUpdateType.state); expect(eventUpdateList[1].type, EventUpdateType.state);
expect(eventUpdateList[2].eventType, 'm.room.encryption'); expect(eventUpdateList[2].content['type'], 'm.room.encryption');
expect(eventUpdateList[2].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[2].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[2].type, EventUpdateType.state); expect(eventUpdateList[2].type, EventUpdateType.state);
expect(eventUpdateList[3].eventType, 'm.room.pinned_events'); expect(eventUpdateList[3].content['type'], 'm.room.pinned_events');
expect(eventUpdateList[3].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[3].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[3].type, EventUpdateType.state); expect(eventUpdateList[3].type, EventUpdateType.state);
expect(eventUpdateList[4].eventType, 'm.room.member'); expect(eventUpdateList[4].content['type'], 'm.room.member');
expect(eventUpdateList[4].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[4].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[4].type, EventUpdateType.timeline); expect(eventUpdateList[4].type, EventUpdateType.timeline);
expect(eventUpdateList[5].eventType, 'm.room.message'); expect(eventUpdateList[5].content['type'], 'm.room.message');
expect(eventUpdateList[5].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[5].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[5].type, EventUpdateType.timeline); expect(eventUpdateList[5].type, EventUpdateType.timeline);
expect(eventUpdateList[6].eventType, 'm.typing'); expect(eventUpdateList[6].content['type'], 'm.typing');
expect(eventUpdateList[6].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[6].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[6].type, EventUpdateType.ephemeral); expect(eventUpdateList[6].type, EventUpdateType.ephemeral);
expect(eventUpdateList[7].eventType, 'm.receipt'); expect(eventUpdateList[7].content['type'], 'm.receipt');
expect(eventUpdateList[7].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[7].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[7].type, EventUpdateType.ephemeral); expect(eventUpdateList[7].type, EventUpdateType.ephemeral);
expect(eventUpdateList[8].eventType, 'm.receipt'); expect(eventUpdateList[8].content['type'], 'm.receipt');
expect(eventUpdateList[8].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[8].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[8].type, EventUpdateType.accountData); expect(eventUpdateList[8].type, EventUpdateType.accountData);
expect(eventUpdateList[9].eventType, 'm.tag'); expect(eventUpdateList[9].content['type'], 'm.tag');
expect(eventUpdateList[9].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[9].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[9].type, EventUpdateType.accountData); expect(eventUpdateList[9].type, EventUpdateType.accountData);
expect(eventUpdateList[10].eventType, 'org.example.custom.room.config'); expect(eventUpdateList[10].content['type'],
'org.example.custom.room.config');
expect(eventUpdateList[10].roomID, '!726s6s6q:example.com'); expect(eventUpdateList[10].roomID, '!726s6s6q:example.com');
expect(eventUpdateList[10].type, EventUpdateType.accountData); expect(eventUpdateList[10].type, EventUpdateType.accountData);
expect(eventUpdateList[11].eventType, 'm.room.name'); expect(eventUpdateList[11].content['type'], 'm.room.name');
expect(eventUpdateList[11].roomID, '!696r7674:example.com'); expect(eventUpdateList[11].roomID, '!696r7674:example.com');
expect(eventUpdateList[11].type, EventUpdateType.inviteState); expect(eventUpdateList[11].type, EventUpdateType.inviteState);
expect(eventUpdateList[12].eventType, 'm.room.member'); expect(eventUpdateList[12].content['type'], 'm.room.member');
expect(eventUpdateList[12].roomID, '!696r7674:example.com'); expect(eventUpdateList[12].roomID, '!696r7674:example.com');
expect(eventUpdateList[12].type, EventUpdateType.inviteState); expect(eventUpdateList[12].type, EventUpdateType.inviteState);
}); });

View File

@ -53,7 +53,6 @@ EventUpdate getLastSentEvent(KeyVerification req) {
'origin_server_ts': DateTime.now().millisecondsSinceEpoch, 'origin_server_ts': DateTime.now().millisecondsSinceEpoch,
'sender': req.client.userID, 'sender': req.client.userID,
}, },
eventType: type,
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: req.room.id, roomID: req.room.id,
); );
@ -448,7 +447,6 @@ void main() {
'origin_server_ts': DateTime.now().millisecondsSinceEpoch, 'origin_server_ts': DateTime.now().millisecondsSinceEpoch,
'sender': client2.userID, 'sender': client2.userID,
}, },
eventType: 'm.key.verification.ready',
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: req2.room.id, roomID: req2.room.id,
)); ));

View File

@ -45,7 +45,6 @@ void main() {
var update = EventUpdate( var update = EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: room.id, roomID: room.id,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'origin_server_ts': 100, 'origin_server_ts': 100,
@ -63,7 +62,6 @@ void main() {
update = EventUpdate( update = EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: room.id, roomID: room.id,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'origin_server_ts': 100, 'origin_server_ts': 100,
@ -80,7 +78,6 @@ void main() {
update = EventUpdate( update = EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: room.id, roomID: room.id,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'origin_server_ts': 100, 'origin_server_ts': 100,
@ -103,7 +100,6 @@ void main() {
update = EventUpdate( update = EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: room.id, roomID: room.id,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'origin_server_ts': 100, 'origin_server_ts': 100,
@ -120,7 +116,6 @@ void main() {
update = EventUpdate( update = EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: room.id, roomID: room.id,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'origin_server_ts': 100, 'origin_server_ts': 100,
@ -145,7 +140,6 @@ void main() {
update = EventUpdate( update = EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: room.id, roomID: room.id,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'origin_server_ts': 100, 'origin_server_ts': 100,
@ -162,7 +156,6 @@ void main() {
update = EventUpdate( update = EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: room.id, roomID: room.id,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'origin_server_ts': 100, 'origin_server_ts': 100,

View File

@ -71,7 +71,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -84,7 +83,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -133,7 +131,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.redaction',
content: { content: {
'type': 'm.room.redaction', 'type': 'm.room.redaction',
'content': {'reason': 'spamming'}, 'content': {'reason': 'spamming'},
@ -168,7 +165,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'test'}, 'content': {'msgtype': 'm.text', 'body': 'test'},
@ -193,7 +189,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -257,7 +252,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -315,7 +309,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -328,7 +321,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -348,7 +340,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -364,7 +355,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -384,7 +374,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -400,7 +389,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -417,7 +405,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -438,7 +425,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -457,7 +443,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -476,7 +461,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -498,7 +482,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -514,7 +497,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -530,7 +512,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -550,7 +531,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -566,7 +546,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},
@ -583,7 +562,6 @@ void main() {
client.onEvent.add(EventUpdate( client.onEvent.add(EventUpdate(
type: EventUpdateType.timeline, type: EventUpdateType.timeline,
roomID: roomID, roomID: roomID,
eventType: 'm.room.message',
content: { content: {
'type': 'm.room.message', 'type': 'm.room.message',
'content': {'msgtype': 'm.text', 'body': 'Testcase'}, 'content': {'msgtype': 'm.text', 'body': 'Testcase'},