From d10b1457ba27b27e2a6ad456d68ad9e00859c18b Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 22 Jun 2015 15:56:16 +0100 Subject: [PATCH] obey room name changes --- src/controllers/organisms/RoomList.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/controllers/organisms/RoomList.js b/src/controllers/organisms/RoomList.js index e4909323..ce533c02 100644 --- a/src/controllers/organisms/RoomList.js +++ b/src/controllers/organisms/RoomList.js @@ -10,6 +10,7 @@ module.exports = { var cli = MatrixClientPeg.get(); cli.on("Room", this.onRoom); cli.on("Room.timeline", this.onRoomTimeline); + cli.on("Room.name", this.onRoomName); this.setState({ roomList: cli.getRooms(), @@ -21,6 +22,7 @@ module.exports = { if (MatrixClientPeg.get()) { MatrixClientPeg.get().removeListener("Room", this.onRoom); MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline); + MatrixClientPeg.get().removeListener("Room.name", this.onRoomName); } }, @@ -46,7 +48,14 @@ module.exports = { var amap = this.state.activityMap; amap[room.roomId] = 1; this.setState({ - roomMap: amap + activityMap: amap + }); + }, + + onRoomName: function(room) { + var cli = MatrixClientPeg.get(); + this.setState({ + roomList: cli.getRooms(), }); },