1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

Make sure integrations are configured before to make any HTTP requests

This commit is contained in:
Frédéric Guillot 2018-04-29 17:58:09 -07:00
parent 31da4db14f
commit 7a1653a2e9
5 changed files with 20 additions and 4 deletions

View file

@ -25,14 +25,14 @@ func SendEntry(entry *model.Entry, integration *model.Integration) {
)
if err != nil {
logger.Error("[Integration] %v", err)
logger.Error("[Integration] UserID #%d: %v", integration.UserID, err)
}
}
if integration.InstapaperEnabled {
client := instapaper.NewClient(integration.InstapaperUsername, integration.InstapaperPassword)
if err := client.AddURL(entry.URL, entry.Title); err != nil {
logger.Error("[Integration] %v", err)
logger.Error("[Integration] UserID #%d: %v", integration.UserID, err)
}
}
@ -46,7 +46,7 @@ func SendEntry(entry *model.Entry, integration *model.Integration) {
)
if err := client.AddEntry(entry.URL, entry.Title); err != nil {
logger.Error("[Integration] %v", err)
logger.Error("[Integration] UserID #%d: %v", integration.UserID, err)
}
}
@ -57,7 +57,7 @@ func SendEntry(entry *model.Entry, integration *model.Integration) {
)
if err := client.AddEntry(entry.URL, entry.Title, entry.Content); err != nil {
logger.Error("[Integration] %v", err)
logger.Error("[Integration] UserID #%d: %v", integration.UserID, err)
}
}
}