summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/nlopes/slack/stars.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-09-07 22:46:58 +0200
committerGitHub <noreply@github.com>2019-09-07 22:46:58 +0200
commita3bee01e0af3394c19360b98fd2db1b647f49299 (patch)
treeffc5778361d55d592a718354a37c9251e75fc7f6 /vendor/github.com/nlopes/slack/stars.go
parent1dc93ec4f001edd01daccbe408767d4878be25a3 (diff)
downloadmatterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.gz
matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.bz2
matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.zip
Update dependencies (#886)
Diffstat (limited to 'vendor/github.com/nlopes/slack/stars.go')
-rw-r--r--vendor/github.com/nlopes/slack/stars.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/nlopes/slack/stars.go b/vendor/github.com/nlopes/slack/stars.go
index 7e1e621d..e84d0447 100644
--- a/vendor/github.com/nlopes/slack/stars.go
+++ b/vendor/github.com/nlopes/slack/stars.go
@@ -2,7 +2,6 @@ package slack
import (
"context"
- "errors"
"net/url"
"strconv"
)
@@ -58,7 +57,7 @@ func (api *Client) AddStarContext(ctx context.Context, channel string, item Item
}
response := &SlackResponse{}
- if err := postSlackMethod(ctx, api.httpclient, "stars.add", values, response, api); err != nil {
+ if err := api.postMethod(ctx, "stars.add", values, response); err != nil {
return err
}
@@ -87,7 +86,7 @@ func (api *Client) RemoveStarContext(ctx context.Context, channel string, item I
}
response := &SlackResponse{}
- if err := postSlackMethod(ctx, api.httpclient, "stars.remove", values, response, api); err != nil {
+ if err := api.postMethod(ctx, "stars.remove", values, response); err != nil {
return err
}
@@ -115,13 +114,15 @@ func (api *Client) ListStarsContext(ctx context.Context, params StarsParameters)
}
response := &listResponseFull{}
- err := postSlackMethod(ctx, api.httpclient, "stars.list", values, response, api)
+ err := api.postMethod(ctx, "stars.list", values, response)
if err != nil {
return nil, nil, err
}
- if !response.Ok {
- return nil, nil, errors.New(response.Error)
+
+ if err := response.Err(); err != nil {
+ return nil, nil, err
}
+
return response.Items, &response.Paging, nil
}