summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/42wim
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/42wim')
-rw-r--r--vendor/github.com/42wim/go-gitter/gitter.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/42wim/go-gitter/gitter.go b/vendor/github.com/42wim/go-gitter/gitter.go
index af082881..2f9e9a51 100644
--- a/vendor/github.com/42wim/go-gitter/gitter.go
+++ b/vendor/github.com/42wim/go-gitter/gitter.go
@@ -125,6 +125,24 @@ func (gitter *Gitter) GetRooms() ([]Room, error) {
return rooms, nil
}
+// GetUsersInRoom returns the users in the room with the passed id
+func (gitter *Gitter) GetUsersInRoom(roomID string) ([]User, error) {
+
+ var users []User
+ response, err := gitter.get(gitter.config.apiBaseURL + "rooms/" + roomID + "/users")
+ if err != nil {
+ gitter.log(err)
+ return nil, err
+ }
+
+ err = json.Unmarshal(response, &users)
+ if err != nil {
+ gitter.log(err)
+ return nil, err
+ }
+ return users, nil
+}
+
// GetRoom returns a room with the passed id
func (gitter *Gitter) GetRoom(roomID string) (*Room, error) {