diff options
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go index 2c3fb5aca..e54f61347 100644 --- a/model/client.go +++ b/model/client.go @@ -820,6 +820,17 @@ func (c *Client) GetClusterStatus() ([]*ClusterInfo, *AppError) { } } +// GetRecentlyActiveUsers returns a map of users including lastActivityAt using user id as the key +func (c *Client) GetRecentlyActiveUsers(teamId string) (*Result, *AppError) { + if r, err := c.DoApiGet("/admin/recently_active_users/"+teamId, "", ""); err != nil { + return nil, err + } else { + defer closeBody(r) + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), UserMapFromJson(r.Body)}, nil + } +} + func (c *Client) GetAllAudits() (*Result, *AppError) { if r, err := c.DoApiGet("/admin/audits", "", ""); err != nil { return nil, err |