integration.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package storage // import "miniflux.app/v2/internal/storage"
  4. import (
  5. "database/sql"
  6. "fmt"
  7. "golang.org/x/crypto/bcrypt"
  8. "miniflux.app/v2/internal/model"
  9. )
  10. // HasDuplicateFeverUsername checks if another user have the same Fever username.
  11. func (s *Storage) HasDuplicateFeverUsername(userID int64, feverUsername string) bool {
  12. query := `SELECT true FROM integrations WHERE user_id != $1 AND fever_username=$2 LIMIT 1`
  13. var result bool
  14. s.db.QueryRow(query, userID, feverUsername).Scan(&result)
  15. return result
  16. }
  17. // HasDuplicateGoogleReaderUsername checks if another user have the same Google Reader username.
  18. func (s *Storage) HasDuplicateGoogleReaderUsername(userID int64, googleReaderUsername string) bool {
  19. query := `SELECT true FROM integrations WHERE user_id != $1 AND googlereader_username=$2 LIMIT 1`
  20. var result bool
  21. s.db.QueryRow(query, userID, googleReaderUsername).Scan(&result)
  22. return result
  23. }
  24. // UserByFeverToken returns a user by using the Fever API token.
  25. func (s *Storage) UserByFeverToken(token string) (*model.User, error) {
  26. query := `
  27. SELECT
  28. users.id, users.username, users.is_admin, users.timezone
  29. FROM
  30. users
  31. LEFT JOIN
  32. integrations ON integrations.user_id=users.id
  33. WHERE
  34. integrations.fever_enabled='t' AND lower(integrations.fever_token)=lower($1)
  35. `
  36. var user model.User
  37. err := s.db.QueryRow(query, token).Scan(&user.ID, &user.Username, &user.IsAdmin, &user.Timezone)
  38. switch {
  39. case err == sql.ErrNoRows:
  40. return nil, nil
  41. case err != nil:
  42. return nil, fmt.Errorf("store: unable to fetch user: %v", err)
  43. default:
  44. return &user, nil
  45. }
  46. }
  47. // GoogleReaderUserCheckPassword validates the Google Reader hashed password.
  48. func (s *Storage) GoogleReaderUserCheckPassword(username, password string) error {
  49. var hash string
  50. query := `
  51. SELECT
  52. googlereader_password
  53. FROM
  54. integrations
  55. WHERE
  56. integrations.googlereader_enabled='t' AND integrations.googlereader_username=$1
  57. `
  58. err := s.db.QueryRow(query, username).Scan(&hash)
  59. if err == sql.ErrNoRows {
  60. return fmt.Errorf(`store: unable to find this user: %s`, username)
  61. } else if err != nil {
  62. return fmt.Errorf(`store: unable to fetch user: %v`, err)
  63. }
  64. if err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)); err != nil {
  65. return fmt.Errorf(`store: invalid password for "%s" (%v)`, username, err)
  66. }
  67. return nil
  68. }
  69. // GoogleReaderUserGetIntegration returns part of the Google Reader parts of the integration struct.
  70. func (s *Storage) GoogleReaderUserGetIntegration(username string) (*model.Integration, error) {
  71. var integration model.Integration
  72. query := `
  73. SELECT
  74. user_id,
  75. googlereader_enabled,
  76. googlereader_username,
  77. googlereader_password
  78. FROM
  79. integrations
  80. WHERE
  81. integrations.googlereader_enabled='t' AND integrations.googlereader_username=$1
  82. `
  83. err := s.db.QueryRow(query, username).Scan(&integration.UserID, &integration.GoogleReaderEnabled, &integration.GoogleReaderUsername, &integration.GoogleReaderPassword)
  84. if err == sql.ErrNoRows {
  85. return &integration, fmt.Errorf(`store: unable to find this user: %s`, username)
  86. } else if err != nil {
  87. return &integration, fmt.Errorf(`store: unable to fetch user: %v`, err)
  88. }
  89. return &integration, nil
  90. }
  91. // Integration returns user integration settings.
  92. func (s *Storage) Integration(userID int64) (*model.Integration, error) {
  93. query := `
  94. SELECT
  95. user_id,
  96. pinboard_enabled,
  97. pinboard_token,
  98. pinboard_tags,
  99. pinboard_mark_as_unread,
  100. instapaper_enabled,
  101. instapaper_username,
  102. instapaper_password,
  103. fever_enabled,
  104. fever_username,
  105. fever_token,
  106. googlereader_enabled,
  107. googlereader_username,
  108. googlereader_password,
  109. wallabag_enabled,
  110. wallabag_only_url,
  111. wallabag_url,
  112. wallabag_client_id,
  113. wallabag_client_secret,
  114. wallabag_username,
  115. wallabag_password,
  116. wallabag_tags,
  117. notion_enabled,
  118. notion_token,
  119. notion_page_id,
  120. nunux_keeper_enabled,
  121. nunux_keeper_url,
  122. nunux_keeper_api_key,
  123. espial_enabled,
  124. espial_url,
  125. espial_api_key,
  126. espial_tags,
  127. readwise_enabled,
  128. readwise_api_key,
  129. telegram_bot_enabled,
  130. telegram_bot_token,
  131. telegram_bot_chat_id,
  132. telegram_bot_topic_id,
  133. telegram_bot_disable_web_page_preview,
  134. telegram_bot_disable_notification,
  135. telegram_bot_disable_buttons,
  136. linkace_enabled,
  137. linkace_url,
  138. linkace_api_key,
  139. linkace_tags,
  140. linkace_is_private,
  141. linkace_check_disabled,
  142. linkding_enabled,
  143. linkding_url,
  144. linkding_api_key,
  145. linkding_tags,
  146. linkding_mark_as_unread,
  147. linkwarden_enabled,
  148. linkwarden_url,
  149. linkwarden_api_key,
  150. matrix_bot_enabled,
  151. matrix_bot_user,
  152. matrix_bot_password,
  153. matrix_bot_url,
  154. matrix_bot_chat_id,
  155. apprise_enabled,
  156. apprise_url,
  157. apprise_services_url,
  158. readeck_enabled,
  159. readeck_url,
  160. readeck_api_key,
  161. readeck_labels,
  162. readeck_only_url,
  163. shiori_enabled,
  164. shiori_url,
  165. shiori_username,
  166. shiori_password,
  167. shaarli_enabled,
  168. shaarli_url,
  169. shaarli_api_secret,
  170. webhook_enabled,
  171. webhook_url,
  172. webhook_secret,
  173. rssbridge_enabled,
  174. rssbridge_url,
  175. omnivore_enabled,
  176. omnivore_api_key,
  177. omnivore_url,
  178. raindrop_enabled,
  179. raindrop_token,
  180. raindrop_collection_id,
  181. raindrop_tags,
  182. betula_enabled,
  183. betula_url,
  184. betula_token,
  185. ntfy_enabled,
  186. ntfy_topic,
  187. ntfy_url,
  188. ntfy_api_token,
  189. ntfy_username,
  190. ntfy_password,
  191. ntfy_icon_url,
  192. ntfy_internal_links,
  193. cubox_enabled,
  194. cubox_api_link,
  195. discord_enabled,
  196. discord_webhook_link,
  197. slack_enabled,
  198. slack_webhook_link,
  199. pushover_enabled,
  200. pushover_user,
  201. pushover_token,
  202. pushover_device,
  203. pushover_prefix,
  204. rssbridge_token,
  205. karakeep_enabled,
  206. karakeep_api_key,
  207. karakeep_url,
  208. linktaco_enabled,
  209. linktaco_api_token,
  210. linktaco_org_slug,
  211. linktaco_tags,
  212. linktaco_visibility,
  213. archiveorg_enabled
  214. FROM
  215. integrations
  216. WHERE
  217. user_id=$1
  218. `
  219. var integration model.Integration
  220. err := s.db.QueryRow(query, userID).Scan(
  221. &integration.UserID,
  222. &integration.PinboardEnabled,
  223. &integration.PinboardToken,
  224. &integration.PinboardTags,
  225. &integration.PinboardMarkAsUnread,
  226. &integration.InstapaperEnabled,
  227. &integration.InstapaperUsername,
  228. &integration.InstapaperPassword,
  229. &integration.FeverEnabled,
  230. &integration.FeverUsername,
  231. &integration.FeverToken,
  232. &integration.GoogleReaderEnabled,
  233. &integration.GoogleReaderUsername,
  234. &integration.GoogleReaderPassword,
  235. &integration.WallabagEnabled,
  236. &integration.WallabagOnlyURL,
  237. &integration.WallabagURL,
  238. &integration.WallabagClientID,
  239. &integration.WallabagClientSecret,
  240. &integration.WallabagUsername,
  241. &integration.WallabagPassword,
  242. &integration.WallabagTags,
  243. &integration.NotionEnabled,
  244. &integration.NotionToken,
  245. &integration.NotionPageID,
  246. &integration.NunuxKeeperEnabled,
  247. &integration.NunuxKeeperURL,
  248. &integration.NunuxKeeperAPIKey,
  249. &integration.EspialEnabled,
  250. &integration.EspialURL,
  251. &integration.EspialAPIKey,
  252. &integration.EspialTags,
  253. &integration.ReadwiseEnabled,
  254. &integration.ReadwiseAPIKey,
  255. &integration.TelegramBotEnabled,
  256. &integration.TelegramBotToken,
  257. &integration.TelegramBotChatID,
  258. &integration.TelegramBotTopicID,
  259. &integration.TelegramBotDisableWebPagePreview,
  260. &integration.TelegramBotDisableNotification,
  261. &integration.TelegramBotDisableButtons,
  262. &integration.LinkAceEnabled,
  263. &integration.LinkAceURL,
  264. &integration.LinkAceAPIKey,
  265. &integration.LinkAceTags,
  266. &integration.LinkAcePrivate,
  267. &integration.LinkAceCheckDisabled,
  268. &integration.LinkdingEnabled,
  269. &integration.LinkdingURL,
  270. &integration.LinkdingAPIKey,
  271. &integration.LinkdingTags,
  272. &integration.LinkdingMarkAsUnread,
  273. &integration.LinkwardenEnabled,
  274. &integration.LinkwardenURL,
  275. &integration.LinkwardenAPIKey,
  276. &integration.MatrixBotEnabled,
  277. &integration.MatrixBotUser,
  278. &integration.MatrixBotPassword,
  279. &integration.MatrixBotURL,
  280. &integration.MatrixBotChatID,
  281. &integration.AppriseEnabled,
  282. &integration.AppriseURL,
  283. &integration.AppriseServicesURL,
  284. &integration.ReadeckEnabled,
  285. &integration.ReadeckURL,
  286. &integration.ReadeckAPIKey,
  287. &integration.ReadeckLabels,
  288. &integration.ReadeckOnlyURL,
  289. &integration.ShioriEnabled,
  290. &integration.ShioriURL,
  291. &integration.ShioriUsername,
  292. &integration.ShioriPassword,
  293. &integration.ShaarliEnabled,
  294. &integration.ShaarliURL,
  295. &integration.ShaarliAPISecret,
  296. &integration.WebhookEnabled,
  297. &integration.WebhookURL,
  298. &integration.WebhookSecret,
  299. &integration.RSSBridgeEnabled,
  300. &integration.RSSBridgeURL,
  301. &integration.OmnivoreEnabled,
  302. &integration.OmnivoreAPIKey,
  303. &integration.OmnivoreURL,
  304. &integration.RaindropEnabled,
  305. &integration.RaindropToken,
  306. &integration.RaindropCollectionID,
  307. &integration.RaindropTags,
  308. &integration.BetulaEnabled,
  309. &integration.BetulaURL,
  310. &integration.BetulaToken,
  311. &integration.NtfyEnabled,
  312. &integration.NtfyTopic,
  313. &integration.NtfyURL,
  314. &integration.NtfyAPIToken,
  315. &integration.NtfyUsername,
  316. &integration.NtfyPassword,
  317. &integration.NtfyIconURL,
  318. &integration.NtfyInternalLinks,
  319. &integration.CuboxEnabled,
  320. &integration.CuboxAPILink,
  321. &integration.DiscordEnabled,
  322. &integration.DiscordWebhookLink,
  323. &integration.SlackEnabled,
  324. &integration.SlackWebhookLink,
  325. &integration.PushoverEnabled,
  326. &integration.PushoverUser,
  327. &integration.PushoverToken,
  328. &integration.PushoverDevice,
  329. &integration.PushoverPrefix,
  330. &integration.RSSBridgeToken,
  331. &integration.KarakeepEnabled,
  332. &integration.KarakeepAPIKey,
  333. &integration.KarakeepURL,
  334. &integration.LinktacoEnabled,
  335. &integration.LinktacoAPIToken,
  336. &integration.LinktacoOrgSlug,
  337. &integration.LinktacoTags,
  338. &integration.LinktacoVisibility,
  339. &integration.ArchiveorgEnabled,
  340. )
  341. switch {
  342. case err == sql.ErrNoRows:
  343. return &integration, nil
  344. case err != nil:
  345. return &integration, fmt.Errorf(`store: unable to fetch integration row: %v`, err)
  346. default:
  347. return &integration, nil
  348. }
  349. }
  350. // UpdateIntegration saves user integration settings.
  351. func (s *Storage) UpdateIntegration(integration *model.Integration) error {
  352. query := `
  353. UPDATE
  354. integrations
  355. SET
  356. pinboard_enabled=$1,
  357. pinboard_token=$2,
  358. pinboard_tags=$3,
  359. pinboard_mark_as_unread=$4,
  360. instapaper_enabled=$5,
  361. instapaper_username=$6,
  362. instapaper_password=$7,
  363. fever_enabled=$8,
  364. fever_username=$9,
  365. fever_token=$10,
  366. wallabag_enabled=$11,
  367. wallabag_only_url=$12,
  368. wallabag_url=$13,
  369. wallabag_client_id=$14,
  370. wallabag_client_secret=$15,
  371. wallabag_username=$16,
  372. wallabag_password=$17,
  373. wallabag_tags=$18,
  374. nunux_keeper_enabled=$19,
  375. nunux_keeper_url=$20,
  376. nunux_keeper_api_key=$21,
  377. googlereader_enabled=$22,
  378. googlereader_username=$23,
  379. googlereader_password=$24,
  380. telegram_bot_enabled=$25,
  381. telegram_bot_token=$26,
  382. telegram_bot_chat_id=$27,
  383. telegram_bot_topic_id=$28,
  384. telegram_bot_disable_web_page_preview=$29,
  385. telegram_bot_disable_notification=$30,
  386. telegram_bot_disable_buttons=$31,
  387. espial_enabled=$32,
  388. espial_url=$33,
  389. espial_api_key=$34,
  390. espial_tags=$35,
  391. linkace_enabled=$36,
  392. linkace_url=$37,
  393. linkace_api_key=$38,
  394. linkace_tags=$39,
  395. linkace_is_private=$40,
  396. linkace_check_disabled=$41,
  397. linkding_enabled=$42,
  398. linkding_url=$43,
  399. linkding_api_key=$44,
  400. linkding_tags=$45,
  401. linkding_mark_as_unread=$46,
  402. matrix_bot_enabled=$47,
  403. matrix_bot_user=$48,
  404. matrix_bot_password=$49,
  405. matrix_bot_url=$50,
  406. matrix_bot_chat_id=$51,
  407. notion_enabled=$52,
  408. notion_token=$53,
  409. notion_page_id=$54,
  410. readwise_enabled=$55,
  411. readwise_api_key=$56,
  412. apprise_enabled=$57,
  413. apprise_url=$58,
  414. apprise_services_url=$59,
  415. readeck_enabled=$60,
  416. readeck_url=$61,
  417. readeck_api_key=$62,
  418. readeck_labels=$63,
  419. readeck_only_url=$64,
  420. shiori_enabled=$65,
  421. shiori_url=$66,
  422. shiori_username=$67,
  423. shiori_password=$68,
  424. shaarli_enabled=$69,
  425. shaarli_url=$70,
  426. shaarli_api_secret=$71,
  427. webhook_enabled=$72,
  428. webhook_url=$73,
  429. webhook_secret=$74,
  430. rssbridge_enabled=$75,
  431. rssbridge_url=$76,
  432. omnivore_enabled=$77,
  433. omnivore_api_key=$78,
  434. omnivore_url=$79,
  435. linkwarden_enabled=$80,
  436. linkwarden_url=$81,
  437. linkwarden_api_key=$82,
  438. raindrop_enabled=$83,
  439. raindrop_token=$84,
  440. raindrop_collection_id=$85,
  441. raindrop_tags=$86,
  442. betula_enabled=$87,
  443. betula_url=$88,
  444. betula_token=$89,
  445. ntfy_enabled=$90,
  446. ntfy_topic=$91,
  447. ntfy_url=$92,
  448. ntfy_api_token=$93,
  449. ntfy_username=$94,
  450. ntfy_password=$95,
  451. ntfy_icon_url=$96,
  452. ntfy_internal_links=$97,
  453. cubox_enabled=$98,
  454. cubox_api_link=$99,
  455. discord_enabled=$100,
  456. discord_webhook_link=$101,
  457. slack_enabled=$102,
  458. slack_webhook_link=$103,
  459. pushover_enabled=$104,
  460. pushover_user=$105,
  461. pushover_token=$106,
  462. pushover_device=$107,
  463. pushover_prefix=$108,
  464. rssbridge_token=$109,
  465. karakeep_enabled=$110,
  466. karakeep_api_key=$111,
  467. karakeep_url=$112,
  468. linktaco_enabled=$113,
  469. linktaco_api_token=$114,
  470. linktaco_org_slug=$115,
  471. linktaco_tags=$116,
  472. linktaco_visibility=$117,
  473. archiveorg_enabled=$118
  474. WHERE
  475. user_id=$119
  476. `
  477. _, err := s.db.Exec(
  478. query,
  479. integration.PinboardEnabled,
  480. integration.PinboardToken,
  481. integration.PinboardTags,
  482. integration.PinboardMarkAsUnread,
  483. integration.InstapaperEnabled,
  484. integration.InstapaperUsername,
  485. integration.InstapaperPassword,
  486. integration.FeverEnabled,
  487. integration.FeverUsername,
  488. integration.FeverToken,
  489. integration.WallabagEnabled,
  490. integration.WallabagOnlyURL,
  491. integration.WallabagURL,
  492. integration.WallabagClientID,
  493. integration.WallabagClientSecret,
  494. integration.WallabagUsername,
  495. integration.WallabagPassword,
  496. integration.WallabagTags,
  497. integration.NunuxKeeperEnabled,
  498. integration.NunuxKeeperURL,
  499. integration.NunuxKeeperAPIKey,
  500. integration.GoogleReaderEnabled,
  501. integration.GoogleReaderUsername,
  502. integration.GoogleReaderPassword,
  503. integration.TelegramBotEnabled,
  504. integration.TelegramBotToken,
  505. integration.TelegramBotChatID,
  506. integration.TelegramBotTopicID,
  507. integration.TelegramBotDisableWebPagePreview,
  508. integration.TelegramBotDisableNotification,
  509. integration.TelegramBotDisableButtons,
  510. integration.EspialEnabled,
  511. integration.EspialURL,
  512. integration.EspialAPIKey,
  513. integration.EspialTags,
  514. integration.LinkAceEnabled,
  515. integration.LinkAceURL,
  516. integration.LinkAceAPIKey,
  517. integration.LinkAceTags,
  518. integration.LinkAcePrivate,
  519. integration.LinkAceCheckDisabled,
  520. integration.LinkdingEnabled,
  521. integration.LinkdingURL,
  522. integration.LinkdingAPIKey,
  523. integration.LinkdingTags,
  524. integration.LinkdingMarkAsUnread,
  525. integration.MatrixBotEnabled,
  526. integration.MatrixBotUser,
  527. integration.MatrixBotPassword,
  528. integration.MatrixBotURL,
  529. integration.MatrixBotChatID,
  530. integration.NotionEnabled,
  531. integration.NotionToken,
  532. integration.NotionPageID,
  533. integration.ReadwiseEnabled,
  534. integration.ReadwiseAPIKey,
  535. integration.AppriseEnabled,
  536. integration.AppriseURL,
  537. integration.AppriseServicesURL,
  538. integration.ReadeckEnabled,
  539. integration.ReadeckURL,
  540. integration.ReadeckAPIKey,
  541. integration.ReadeckLabels,
  542. integration.ReadeckOnlyURL,
  543. integration.ShioriEnabled,
  544. integration.ShioriURL,
  545. integration.ShioriUsername,
  546. integration.ShioriPassword,
  547. integration.ShaarliEnabled,
  548. integration.ShaarliURL,
  549. integration.ShaarliAPISecret,
  550. integration.WebhookEnabled,
  551. integration.WebhookURL,
  552. integration.WebhookSecret,
  553. integration.RSSBridgeEnabled,
  554. integration.RSSBridgeURL,
  555. integration.OmnivoreEnabled,
  556. integration.OmnivoreAPIKey,
  557. integration.OmnivoreURL,
  558. integration.LinkwardenEnabled,
  559. integration.LinkwardenURL,
  560. integration.LinkwardenAPIKey,
  561. integration.RaindropEnabled,
  562. integration.RaindropToken,
  563. integration.RaindropCollectionID,
  564. integration.RaindropTags,
  565. integration.BetulaEnabled,
  566. integration.BetulaURL,
  567. integration.BetulaToken,
  568. integration.NtfyEnabled,
  569. integration.NtfyTopic,
  570. integration.NtfyURL,
  571. integration.NtfyAPIToken,
  572. integration.NtfyUsername,
  573. integration.NtfyPassword,
  574. integration.NtfyIconURL,
  575. integration.NtfyInternalLinks,
  576. integration.CuboxEnabled,
  577. integration.CuboxAPILink,
  578. integration.DiscordEnabled,
  579. integration.DiscordWebhookLink,
  580. integration.SlackEnabled,
  581. integration.SlackWebhookLink,
  582. integration.PushoverEnabled,
  583. integration.PushoverUser,
  584. integration.PushoverToken,
  585. integration.PushoverDevice,
  586. integration.PushoverPrefix,
  587. integration.RSSBridgeToken,
  588. integration.KarakeepEnabled,
  589. integration.KarakeepAPIKey,
  590. integration.KarakeepURL,
  591. integration.LinktacoEnabled,
  592. integration.LinktacoAPIToken,
  593. integration.LinktacoOrgSlug,
  594. integration.LinktacoTags,
  595. integration.LinktacoVisibility,
  596. integration.ArchiveorgEnabled,
  597. integration.UserID,
  598. )
  599. if err != nil {
  600. return fmt.Errorf(`store: unable to update integration record: %v`, err)
  601. }
  602. return nil
  603. }
  604. // HasSaveEntry returns true if the given user can save articles to third-parties.
  605. func (s *Storage) HasSaveEntry(userID int64) (result bool) {
  606. query := `
  607. SELECT
  608. true
  609. FROM
  610. integrations
  611. WHERE
  612. user_id=$1
  613. AND
  614. (
  615. pinboard_enabled='t' OR
  616. instapaper_enabled='t' OR
  617. wallabag_enabled='t' OR
  618. notion_enabled='t' OR
  619. nunux_keeper_enabled='t' OR
  620. espial_enabled='t' OR
  621. readwise_enabled='t' OR
  622. linkace_enabled='t' OR
  623. linkding_enabled='t' OR
  624. linktaco_enabled='t' OR
  625. linkwarden_enabled='t' OR
  626. apprise_enabled='t' OR
  627. shiori_enabled='t' OR
  628. readeck_enabled='t' OR
  629. shaarli_enabled='t' OR
  630. webhook_enabled='t' OR
  631. omnivore_enabled='t' OR
  632. karakeep_enabled='t' OR
  633. raindrop_enabled='t' OR
  634. betula_enabled='t' OR
  635. cubox_enabled='t' OR
  636. discord_enabled='t' OR
  637. slack_enabled='t' OR
  638. archiveorg_enabled='t'
  639. )
  640. `
  641. if err := s.db.QueryRow(query, userID).Scan(&result); err != nil {
  642. result = false
  643. }
  644. return result
  645. }