mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-16 01:39:21 +02:00
allow params with values
This commit is contained in:
parent
679348d1f7
commit
62f653fc28
|
@ -269,8 +269,8 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
|
|||
perform := url.URL{
|
||||
Scheme: "https",
|
||||
Host: instance,
|
||||
RawQuery: params.Encode(),
|
||||
}
|
||||
var paramval []string
|
||||
withFiles := "false"
|
||||
withReplies := "false"
|
||||
globalTimeline := false
|
||||
|
@ -285,9 +285,14 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
|
|||
globalTimeline = true
|
||||
params.Set(instanceParam, "true")
|
||||
default:
|
||||
paramval = strings.Split(instanceParam, "=")
|
||||
if len(paramval) == 2 {
|
||||
params.Set(paramval[0], paramval[1])
|
||||
} else {
|
||||
params.Set(instanceParam, "true")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var method string
|
||||
var ContentType string
|
||||
|
@ -313,6 +318,10 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
|
|||
}
|
||||
}
|
||||
default:
|
||||
if globalTimeline {
|
||||
params.Set("local", "false")
|
||||
}
|
||||
perform.RawQuery = params.Encode()
|
||||
perform.Path = "api/v1/timelines/public"
|
||||
method = http.MethodGet
|
||||
ContentType = "application/x-www-form-urlencoded"
|
||||
|
|
Loading…
Reference in New Issue