diff options
author | enahum <nahumhbl@gmail.com> | 2016-09-06 15:48:43 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 15:48:43 -0300 |
commit | 35b816b92217237de922c928a6623b5ac426655a (patch) | |
tree | adf7e7a96bd4b50aae0b295f94f8501643e7fc38 /model/client.go | |
parent | 9a9ae3dcd1c248a5d9e6f986ea967fa8bbf06f19 (diff) | |
download | chat-35b816b92217237de922c928a6623b5ac426655a.tar.gz chat-35b816b92217237de922c928a6623b5ac426655a.tar.bz2 chat-35b816b92217237de922c928a6623b5ac426655a.zip |
PLT-3921 Fix System Console Recent Active Users (#3856)
* PLT-3921 System Console Recent Active Users
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 |