diff options
Diffstat (limited to 'matrix/rooms')
-rw-r--r-- | matrix/rooms/room.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/matrix/rooms/room.go b/matrix/rooms/room.go index 45222e1..d5d1d8f 100644 --- a/matrix/rooms/room.go +++ b/matrix/rooms/room.go @@ -650,6 +650,17 @@ func (room *Room) GetMembers() map[id.UserID]*Member { return room.memberCache } +func (room *Room) GetMemberList() []id.UserID { + members := room.GetMembers() + memberList := make([]id.UserID, len(members)) + index := 0 + for userID, _ := range members { + memberList[index] = userID + index++ + } + return memberList +} + // GetMember returns the member with the given MXID. // If the member doesn't exist, nil is returned. func (room *Room) GetMember(userID id.UserID) *Member { |