maubot / rss

A RSS plugin for maubot
GNU Affero General Public License v3.0
69 stars 21 forks source link

Add no-send option to config, to skip sending updates to matrix #21

Open jfowl opened 3 years ago

jfowl commented 3 years ago

We are currently migrating feeds to a different baseURL, which means that maubot-rss would recognize all items as new, because their url changed. We don't want all users to get spammed with old messages again.

https://github.com/rss2email/rss2email#using-rss2email has a --no-send flag which still logs "new" items into the database as seen, but skips sending a notification for them.

I could imagine such an option beeing useful for maubot-rss as well. If this is wanted, I would offer to implement this somewhat like this:

# bot.py line 143...
skip_broadcast = self.config["skip_broadcast"]
if not skip_broadcast:
    for entry in new_entries.values():
        await self._broadcast(feed, entry, feed.subscriptions)
else:
    self.log.debug("Skipped broadcasting new items because config option skip_broadcasting was set to True")