aboutsummaryrefslogtreecommitdiff
path: root/mastodon
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-01-30 15:32:37 +0000
committerr <r@freesoftwareextremist.com>2020-01-30 15:37:07 +0000
commit17e55d2a9bc7d0f5ed922370b8ac3ad4db9f583b (patch)
tree37f94e17e31d7485d16b6d9922023ffb182a5e6d /mastodon
parent84cd3bc4368afdfe41320b1388fd9a14bf90fce9 (diff)
downloadbloat-17e55d2a9bc7d0f5ed922370b8ac3ad4db9f583b.tar.gz
bloat-17e55d2a9bc7d0f5ed922370b8ac3ad4db9f583b.zip
Add user search page
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/status.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/mastodon/status.go b/mastodon/status.go
index 5be4f49..22f042c 100644
--- a/mastodon/status.go
+++ b/mastodon/status.go
@@ -284,14 +284,17 @@ func (c *Client) DeleteStatus(ctx context.Context, id string) error {
}
// Search search content with query.
-func (c *Client) Search(ctx context.Context, q string, qType string, limit int, resolve bool, offset int) (*Results, error) {
+func (c *Client) Search(ctx context.Context, q string, qType string, limit int, resolve bool, offset int, accountID string) (*Results, error) {
+ var results Results
params := url.Values{}
params.Set("q", q)
params.Set("type", qType)
params.Set("limit", fmt.Sprint(limit))
params.Set("resolve", fmt.Sprint(resolve))
params.Set("offset", fmt.Sprint(offset))
- var results Results
+ if len(accountID) > 0 {
+ params.Set("account_id", accountID)
+ }
err := c.doAPI(ctx, http.MethodGet, "/api/v2/search", params, &results, nil)
if err != nil {
return nil, err