RSS: When deleting a named feed, preserve anonymous feed of the same URL.

This commit is contained in:
Valentin Lorentz 2021-08-22 19:21:28 +02:00
parent cbd2b31d8f
commit 0c8e455b4e
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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):