1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Do not show save link if no integration is configured

This commit is contained in:
Frédéric Guillot 2018-04-29 17:43:40 -07:00
parent b166ceaea7
commit 31da4db14f
20 changed files with 133 additions and 100 deletions

View file

@ -176,3 +176,18 @@ func (s *Storage) CreateIntegration(userID int64) error {
return nil
}
// HasSaveEntry returns true if the given user can save articles to third-parties.
func (s *Storage) HasSaveEntry(userID int64) (result bool) {
query := `
SELECT true FROM integrations
WHERE user_id=$1 AND
(pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR nunux_keeper_enabled='t')
`
if err := s.db.QueryRow(query, userID).Scan(&result); err != nil {
result = false
}
return result
}