diff --git a/src/models/room.js b/src/models/room.js index e95bc6850..94115ef45 100644 --- a/src/models/room.js +++ b/src/models/room.js @@ -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.