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

Add matrix bot support

This commit is contained in:
Romain de Laage 2022-10-14 17:18:44 +02:00 committed by Frédéric Guillot
parent 3f14d08095
commit 550e7d0415
28 changed files with 259 additions and 5 deletions

View file

@ -41,6 +41,9 @@ var (
func ProcessFeedEntries(store *storage.Storage, feed *model.Feed, user *model.User) {
var filteredEntries model.Entries
// array used for bulk push
entriesToPush := model.Entries{}
for _, entry := range feed.Entries {
logger.Debug("[Processor] Processing entry %q from feed %q", entry.URL, feed.FeedURL)
@ -93,6 +96,7 @@ func ProcessFeedEntries(store *storage.Storage, feed *model.Feed, user *model.Us
go func() {
integration.PushEntry(localEntry, intg)
}()
entriesToPush = append(entriesToPush, localEntry)
}
}
@ -100,6 +104,15 @@ func ProcessFeedEntries(store *storage.Storage, feed *model.Feed, user *model.Us
filteredEntries = append(filteredEntries, entry)
}
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 {
go func() {
integration.PushEntries(entriesToPush, intg)
}()
}
feed.Entries = filteredEntries
}