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

Add Telegram integration

This commit is contained in:
三三 2021-09-08 11:04:22 +08:00 committed by GitHub
parent 93596c1218
commit 34dd358eb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 173 additions and 4 deletions

View file

@ -14,6 +14,8 @@ import (
"time"
"unicode/utf8"
"miniflux.app/integration"
"miniflux.app/config"
"miniflux.app/http/client"
"miniflux.app/logger"
@ -80,6 +82,18 @@ func ProcessFeedEntries(store *storage.Storage, feed *model.Feed) {
// The sanitizer should always run at the end of the process to make sure unsafe HTML is filtered.
entry.Content = sanitizer.Sanitize(entry.URL, entry.Content)
if entryIsNew {
intg, err := store.Integration(feed.UserID)
if err != nil {
logger.Error("[Processor] Get integrations for user %d failed: %v; the refresh process will go on, but no integrations will run this time.", feed.UserID, err)
} else if intg != nil {
localEntry := entry
go func() {
integration.PushEntry(localEntry, intg)
}()
}
}
updateEntryReadingTime(store, feed, entry, entryIsNew)
filteredEntries = append(filteredEntries, entry)
}