From 0c8e455b4e80dabf2a4eee956239b6b48da229db Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 22 Aug 2021 19:21:28 +0200 Subject: [PATCH] RSS: When deleting a named feed, preserve anonymous feed of the same URL. --- plugins/RSS/plugin.py | 4 +++- plugins/RSS/test.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/RSS/plugin.py b/plugins/RSS/plugin.py index 613c320bf..f35bd0ac7 100644 --- a/plugins/RSS/plugin.py +++ b/plugins/RSS/plugin.py @@ -287,7 +287,9 @@ class RSS(callbacks.Plugin): def register_feed(self, name, url, initial, plugin_is_loading, announced=None): - self.feed_names[name] = url + if name != url: + # If name == url, then it's an anonymous feed + self.feed_names[name] = url self.feeds[url] = Feed(name, url, initial, plugin_is_loading, announced) diff --git a/plugins/RSS/test.py b/plugins/RSS/test.py index d6bb00f69..5a2b52a6a 100644 --- a/plugins/RSS/test.py +++ b/plugins/RSS/test.py @@ -111,6 +111,7 @@ class RSSTestCase(ChannelPluginTestCase): self.assertNotError('rss announce remove http://xkcd.com/rss.xml') self.assertNotError('rss remove xkcd') self.assertEqual(self.irc.getCallback('RSS').feed_names, {}) + self.assertTrue(self.irc.getCallback('RSS').get_feed('http://xkcd.com/rss.xml')) @mock_urllib def testInitialAnnounceNewest(self, mock):