From 366a24bbe43d5624d04ad7fa98df7e94256cf54b Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 22 Jan 2016 15:11:36 +0000 Subject: [PATCH] Refresh the membership list on 3PID invites --- src/components/views/rooms/MemberList.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index 3af4cdc44f..de6911b2bd 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -51,6 +51,7 @@ module.exports = React.createClass({ var cli = MatrixClientPeg.get(); cli.on("RoomState.members", this.onRoomStateMember); cli.on("RoomMember.name", this.onRoomMemberName); + cli.on("RoomState.events", this.onRoomStateEvent); cli.on("Room", this.onRoom); // invites }, @@ -60,6 +61,7 @@ module.exports = React.createClass({ MatrixClientPeg.get().removeListener("RoomState.members", this.onRoomStateMember); MatrixClientPeg.get().removeListener("RoomMember.name", this.onRoomMemberName); MatrixClientPeg.get().removeListener("User.presence", this.userPresenceFn); + MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvent); } }, @@ -133,6 +135,12 @@ module.exports = React.createClass({ this._updateList(); }, + onRoomStateEvent: function(event, state) { + if (event.getType() === "m.room.third_party_invite") { + this._updateList(); + } + }, + _updateList: function() { this.memberDict = this.getMemberDict();