Fix membership table column

This commit is contained in:
Christian Pauly 2019-06-12 12:30:22 +02:00
parent d5d1aa53b2
commit db3c3f0c6d
2 changed files with 4 additions and 0 deletions

View file

@ -364,6 +364,7 @@ class Room {
return Room( return Room(
id: row["id"], id: row["id"],
name: name, name: name,
membership: row["membership"],
topic: row["description"], topic: row["description"],
avatar: MxContent(avatarUrl), avatar: MxContent(avatarUrl),
notificationCount: row["notification_count"], notificationCount: row["notification_count"],

View file

@ -42,6 +42,7 @@ void main() {
final String id = "!localpart:server.abc"; final String id = "!localpart:server.abc";
final String name = "My Room"; final String name = "My Room";
final String membership = "join";
final String topic = "This is my own room"; final String topic = "This is my own room";
final int unread = DateTime.now().millisecondsSinceEpoch; final int unread = DateTime.now().millisecondsSinceEpoch;
final int notificationCount = 2; final int notificationCount = 2;
@ -60,6 +61,7 @@ void main() {
final Map<String, dynamic> jsonObj = { final Map<String, dynamic> jsonObj = {
"id": id, "id": id,
"membership": membership,
"topic": name, "topic": name,
"description": topic, "description": topic,
"avatar_url": "", "avatar_url": "",
@ -93,6 +95,7 @@ void main() {
room = await Room.getRoomFromTableRow(jsonObj, matrix); room = await Room.getRoomFromTableRow(jsonObj, matrix);
expect(room.id, id); expect(room.id, id);
expect(room.membership, membership);
expect(room.name, name); expect(room.name, name);
expect(room.topic, topic); expect(room.topic, topic);
expect(room.avatar.mxc, ""); expect(room.avatar.mxc, "");