You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-09-01 21:21:58 +03:00
Sync room state when joining via client.joinRoom
Does not currently sync state when another device joins. Update node example app to refresh room list.
This commit is contained in:
@@ -55,6 +55,18 @@ utils.inherits(Room, EventEmitter);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if the given user_id has the given membership state.
|
||||
* @param {string} userId The user ID to check.
|
||||
* @param {string} membership The membership e.g. <code>'join'</code>
|
||||
* @return {boolean} True if this user_id has the given membership state.
|
||||
*/
|
||||
Room.prototype.hasMembershipState = function(userId, membership) {
|
||||
return utils.filter(this.currentState.getMembers(), function(m) {
|
||||
return m.membership === membership && m.userId === userId;
|
||||
}).length > 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add some events to this room's timeline. Will fire "Room.timeline" for
|
||||
* each event added.
|
||||
|
Reference in New Issue
Block a user