diff options
-rw-r--r-- | data/rbot/plugins/rss.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 483355c7..094b4571 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -414,7 +414,25 @@ class RSSFeedsPlugin < Plugin m.reply "lemme fetch it..."
title = items = nil
- fetched = fetchRss(feed, m, false)
+ we_were_watching = false
+
+ if @watch.key?(feed.handle)
+ # If a feed is being watched, we run the watcher thread
+ # so that all watchers can be informed of changes to
+ # the feed. Before we do that, though, we remove the
+ # show requester from the watchlist, if present, lest
+ # he gets the update twice.
+ if feed.watched_by?(m.replyto)
+ we_were_watching = true
+ feed.rm_watch(m.replyto)
+ end
+ @bot.timer.reschedule(@watch[feed.handle], 0)
+ if we_were_watching
+ feed.add_watch(m.replyto)
+ end
+ else
+ fetched = fetchRss(feed, m, false)
+ end
return unless fetched or feed.xml
if not fetched and feed.items
m.reply "using old data"
|