You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-08 19:08:34 +03:00
Merge pull request #697 from matrix-org/dbkr/joined_member_count_wrapper
Add wrapper around getJoinedMemberCount()
This commit is contained in:
@@ -625,6 +625,25 @@ Room.prototype.addEventsToTimeline = function(events, toStartOfTimeline,
|
||||
return this.getMembersWithMembership("join");
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the number of joined members in this room
|
||||
* This method caches the result.
|
||||
* This is a wrapper around the method of the same name in roomState, returning
|
||||
* its result for the room's current state.
|
||||
* @return {integer} The number of members in this room whose membership is 'join'
|
||||
*/
|
||||
Room.prototype.getJoinedMemberCount = function() {
|
||||
return this.currentState.getJoinedMemberCount();
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the number of invited members in this room
|
||||
* @return {integer} The number of members in this room whose membership is 'invite'
|
||||
*/
|
||||
Room.prototype.getInvitedMemberCount = function() {
|
||||
return this.currentState.getInvitedMemberCount();
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a list of members with given membership state.
|
||||
* @param {string} membership The membership state.
|
||||
|
||||
Reference in New Issue
Block a user