summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/slack-go/slack/users.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/slack-go/slack/users.go')
-rw-r--r--vendor/github.com/slack-go/slack/users.go16
1 files changed, 12 insertions, 4 deletions
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