aboutsummaryrefslogtreecommitdiff
path: root/client/client.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client/client.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/client.go b/client/client.go
index 11659164..a463b2d7 100644
--- a/client/client.go
+++ b/client/client.go
@@ -185,6 +185,25 @@ func (c *Client) MarkAllAsRead(userID int64) error {
return err
}
+// FetchIntegrationsStatus fetches the integrations status for a user.
+func (c *Client) FetchIntegrationsStatus() (bool, error) {
+ body, err := c.request.Get("/v1/users/integrations/status")
+ if err != nil {
+ return false, err
+ }
+ defer body.Close()
+
+ var response struct {
+ HasIntegrations bool `json:"has_integrations"`
+ }
+
+ if err := json.NewDecoder(body).Decode(&response); err != nil {
+ return false, fmt.Errorf("miniflux: response error (%v)", err)
+ }
+
+ return response.HasIntegrations, nil
+}
+
// Discover try to find subscriptions from a website.
func (c *Client) Discover(url string) (Subscriptions, error) {
body, err := c.request.Post("/v1/discover", map[string]string{"url": url})