From 4f20ebead36876a88391bf033d1de3e4cf0228da Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 31 Dec 2020 14:48:12 +0100 Subject: Update vendor for next release (#1343) --- vendor/github.com/slack-go/slack/users.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/slack-go/slack/users.go') diff --git a/vendor/github.com/slack-go/slack/users.go b/vendor/github.com/slack-go/slack/users.go index cdef4242..c2ee8713 100644 --- a/vendor/github.com/slack-go/slack/users.go +++ b/vendor/github.com/slack-go/slack/users.go @@ -513,7 +513,7 @@ func (api *Client) DeleteUserPhotoContext(ctx context.Context) (err error) { // // For more information see SetUserRealNameContextWithUser func (api *Client) SetUserRealName(realName string) error { - return api.SetUserRealNameContextWithUser(context.Background(), realName, realName) + return api.SetUserRealNameContextWithUser(context.Background(), "", realName) } // SetUserRealNameContextWithUser will set a real name for the provided user with a custom context @@ -531,11 +531,15 @@ func (api *Client) SetUserRealNameContextWithUser(ctx context.Context, user, rea } values := url.Values{ - "user": {user}, "token": {api.token}, "profile": {string(profile)}, } + // optional field. It should not be set if empty + if user != "" { + values["user"] = []string{user} + } + response := &userResponseFull{} if err = api.postMethod(ctx, "users.profile.set", values, response); err != nil { return err @@ -557,7 +561,7 @@ func (api *Client) SetUserCustomStatus(statusText, statusEmoji string, statusExp // // For more information see SetUserCustomStatus func (api *Client) SetUserCustomStatusContext(ctx context.Context, statusText, statusEmoji string, statusExpiration int64) error { - return api.SetUserCustomStatusContextWithUser(context.Background(), "", statusText, statusEmoji, statusExpiration) + return api.SetUserCustomStatusContextWithUser(ctx, "", statusText, statusEmoji, statusExpiration) } // SetUserCustomStatusWithUser will set a custom status and emoji for the provided user. @@ -598,11 +602,15 @@ func (api *Client) SetUserCustomStatusContextWithUser(ctx context.Context, user, } values := url.Values{ - "user": {user}, "token": {api.token}, "profile": {string(profile)}, } + // optional field. It should not be set if empty + if user != "" { + values["user"] = []string{user} + } + response := &userResponseFull{} if err = api.postMethod(ctx, "users.profile.set", values, response); err != nil { return err -- cgit v1.2.3