diff options
Diffstat (limited to 'internal/ui')
-rw-r--r-- | internal/ui/form/integration.go | 6 | ||||
-rw-r--r-- | internal/ui/integration_show.go | 2 | ||||
-rw-r--r-- | internal/ui/subscription_submit.go | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/internal/ui/form/integration.go b/internal/ui/form/integration.go index 0d6b4e19..2976ed6d 100644 --- a/internal/ui/form/integration.go +++ b/internal/ui/form/integration.go @@ -77,6 +77,8 @@ type IntegrationForm struct { WebhookEnabled bool WebhookURL string WebhookSecret string + RSSBridgeEnabled bool + RSSBridgeURL string } // Merge copy form values to the model. @@ -143,6 +145,8 @@ func (i IntegrationForm) Merge(integration *model.Integration) { integration.ShaarliAPISecret = i.ShaarliAPISecret integration.WebhookEnabled = i.WebhookEnabled integration.WebhookURL = i.WebhookURL + integration.RSSBridgeEnabled = i.RSSBridgeEnabled + integration.RSSBridgeURL = i.RSSBridgeURL } // NewIntegrationForm returns a new IntegrationForm. @@ -212,6 +216,8 @@ func NewIntegrationForm(r *http.Request) *IntegrationForm { ShaarliAPISecret: r.FormValue("shaarli_api_secret"), WebhookEnabled: r.FormValue("webhook_enabled") == "1", WebhookURL: r.FormValue("webhook_url"), + RSSBridgeEnabled: r.FormValue("rssbridge_enabled") == "1", + RSSBridgeURL: r.FormValue("rssbridge_url"), } } diff --git a/internal/ui/integration_show.go b/internal/ui/integration_show.go index e3dbc08d..d27ce412 100644 --- a/internal/ui/integration_show.go +++ b/internal/ui/integration_show.go @@ -91,6 +91,8 @@ func (h *handler) showIntegrationPage(w http.ResponseWriter, r *http.Request) { WebhookEnabled: integration.WebhookEnabled, WebhookURL: integration.WebhookURL, WebhookSecret: integration.WebhookSecret, + RSSBridgeEnabled: integration.RSSBridgeEnabled, + RSSBridgeURL: integration.RSSBridgeURL, } sess := session.New(h.store, request.SessionID(r)) diff --git a/internal/ui/subscription_submit.go b/internal/ui/subscription_submit.go index 75774c2e..41e75a4a 100644 --- a/internal/ui/subscription_submit.go +++ b/internal/ui/subscription_submit.go @@ -50,6 +50,11 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) { return } + var rssbridgeURL string + if intg, err := h.store.Integration(user.ID); err == nil && intg != nil && intg.RSSBridgeEnabled { + rssbridgeURL = intg.RSSBridgeURL + } + subscriptions, findErr := subscription.FindSubscriptions( subscriptionForm.URL, subscriptionForm.UserAgent, @@ -58,6 +63,7 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) { subscriptionForm.Password, subscriptionForm.FetchViaProxy, subscriptionForm.AllowSelfSignedCertificates, + rssbridgeURL, ) if findErr != nil { v.Set("form", subscriptionForm) |