Skip to content

Resolve "Import RSS feeds shared by other apps"

akwizgran requested to merge 1822-rss-feeds-backend into master

This branch implements the backend for #1822 (closed), adding a FeedManager method that can be used to import an RSS feed from an InputStream and turn it into a Briar blog. If the stream contains an update to an existing feed then any new posts are added to the existing blog, otherwise a new blog is created.

When we import an RSS feed from a file, we need to know whether this is a new feed or an update for an existing feed. Previously we used the URL to determine this. But when importing an RSS feed from a file, we don't necessarily know the URL that should be used for updating the feed (the various RSS and Atom specs have different properties that may contain this URL, but real feeds may omit these properties or use a different value, such as the URL of the corresponding web page). So if the URL is missing, we match the feed heuristically against our existing feeds using the following properties: title, description, author, link and URI. The properties of feeds that are relevant for matching are factored out into a new RssProperties class.

Similarly, when we import an RSS feed from a URL, it may be an update for a feed that was originally imported from a file. So we need to match the feed against existing feeds in this case too. This allows us to make a small improvement in the Android UI: previously, trying to add a feed that already existed would result in an error message if the URL was the same, or a duplicated feed if the URL was different (eg https://schneier.com/blog/atom.xml and https://schneier.com/feed/atom, which point to the same feed). Now both of these cases will cause the existing feed to be updated.

Merge request reports