Add ability to click-to-invite
This commit is contained in:
parent
165adde0c8
commit
36616a97a1
2 changed files with 22 additions and 8 deletions
|
@ -320,11 +320,10 @@ module.exports = React.createClass({
|
|||
// TODO: Cache this calculation
|
||||
var room = MatrixClientPeg.get().getRoom(this.props.roomId);
|
||||
var allUsers = MatrixClientPeg.get().getUsers();
|
||||
// only add Users if they don't exist in the member list
|
||||
// only add Users if they are not joined
|
||||
allUsers = allUsers.filter(function(u) {
|
||||
return room.getMember(u.userId) === null;
|
||||
return !room.hasMembershipState(u.userId, "join");
|
||||
});
|
||||
|
||||
var SearchableEntityList = sdk.getComponent("rooms.SearchableEntityList");
|
||||
|
||||
return (
|
||||
|
@ -332,9 +331,9 @@ module.exports = React.createClass({
|
|||
onSubmit={this.onInvite}
|
||||
entities={
|
||||
Entities.fromRoomMembers(
|
||||
room.currentState.getMembers() // ALLLLL OF THEM
|
||||
room.getJoinedMembers()
|
||||
).concat(
|
||||
Entities.fromUsers(allUsers)
|
||||
Entities.fromUsers(allUsers, true, this.onInvite)
|
||||
)
|
||||
} />
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue