diff options
author | Wim <wim@42.be> | 2021-05-05 22:03:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-05 22:03:28 +0200 |
commit | a0bca42a7ad98a37f4bdc4d7adc419471163edfb (patch) | |
tree | 3e87fdb61128039b016adb4e586636484c63ed52 /vendor/github.com/slack-go/slack/users.go | |
parent | af543dcd05cfb5341311e2e214727e26411d2f92 (diff) | |
download | matterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.tar.gz matterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.tar.bz2 matterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.zip |
Update vendor (#1461)
* Update vendored libs
* Fix slack api changes
Diffstat (limited to 'vendor/github.com/slack-go/slack/users.go')
-rw-r--r-- | vendor/github.com/slack-go/slack/users.go | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/vendor/github.com/slack-go/slack/users.go b/vendor/github.com/slack-go/slack/users.go index 82657d76..3696e37f 100644 --- a/vendor/github.com/slack-go/slack/users.go +++ b/vendor/github.com/slack-go/slack/users.go @@ -482,7 +482,7 @@ func (api *Client) SetUserPhotoContext(ctx context.Context, image string, params values.Add("crop_w", strconv.Itoa(params.CropW)) } - err = postLocalWithMultipartResponse(ctx, api.httpclient, api.endpoint+"users.setPhoto", image, "image", values, response, api) + err = postLocalWithMultipartResponse(ctx, api.httpclient, api.endpoint+"users.setPhoto", image, "image", api.token, values, response, api) if err != nil { return err } @@ -632,9 +632,15 @@ func (api *Client) UnsetUserCustomStatusContext(ctx context.Context) error { return api.SetUserCustomStatusContext(ctx, "", "", 0) } +// GetUserProfileParameters are the parameters required to get user profile +type GetUserProfileParameters struct { + UserID string + IncludeLabels bool +} + // GetUserProfile retrieves a user's profile information. -func (api *Client) GetUserProfile(userID string, includeLabels bool) (*UserProfile, error) { - return api.GetUserProfileContext(context.Background(), userID, includeLabels) +func (api *Client) GetUserProfile(params *GetUserProfileParameters) (*UserProfile, error) { + return api.GetUserProfileContext(context.Background(), params) } type getUserProfileResponse struct { @@ -643,13 +649,14 @@ type getUserProfileResponse struct { } // GetUserProfileContext retrieves a user's profile information with a context. -func (api *Client) GetUserProfileContext(ctx context.Context, userID string, includeLabels bool) (*UserProfile, error) { +func (api *Client) GetUserProfileContext(ctx context.Context, params *GetUserProfileParameters) (*UserProfile, error) { values := url.Values{"token": {api.token}} - if includeLabels { - values.Add("include_labels", "true") + + if params.UserID != "" { + values.Add("user", params.UserID) } - if userID != "" { - values.Add("user", userID) + if params.IncludeLabels { + values.Add("include_labels", "true") } resp := &getUserProfileResponse{} |