Skip to content

Commit 01b925e

Browse files
UserList - populateRoom function added.
1 parent 21a659b commit 01b925e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/client/state/UserList.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,17 @@ class UserList extends EventEmitter {
111111
}
112112
}
113113

114+
populateRoom(room) {
115+
const tinyThis = this;
116+
room.getJoinedMembers().forEach((member) => {
117+
tinyThis._addUser(room.roomId, member.userId);
118+
});
119+
}
120+
114121
_populateRooms() {
115122
const tinyThis = this;
116-
this.users.clear();
117123
this.matrixClient.getRooms().forEach((room) => {
118-
room.getJoinedMembers().forEach((member) => {
119-
tinyThis._addUser(room.roomId, member.userId);
120-
});
124+
tinyThis.populateRoom(room);
121125
});
122126
}
123127

0 commit comments

Comments
 (0)