summaryrefslogtreecommitdiff
path: root/data/rbot/plugins
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-08 16:41:01 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-08 16:41:01 +0000
commitb593dcf992727377feec931c0cfc5534520f6bfa (patch)
treefa688534dae17b010773d7a85f4fe6feee3d18ea /data/rbot/plugins
parent257761628ebabf6c176a1def26ea2c92982f9658 (diff)
rss plugin: don't flood watcher with current rss content when a watch is added
Diffstat (limited to 'data/rbot/plugins')
-rw-r--r--data/rbot/plugins/rss.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index a067cbba..8b132ba6 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -641,16 +641,18 @@ class RSSFeedsPlugin < Plugin
end
status = Hash.new
status[:failures] = 0
+ status[:first_run] = true
@watch[feed.handle] = @bot.timer.add(0, status) {
debug "watcher for #{feed} started"
failures = status[:failures]
+ first_run = status.delete(:first_run)
begin
debug "fetching #{feed}"
oldxml = feed.xml ? feed.xml.dup : nil
unless fetchRss(feed)
failures += 1
else
- if oldxml and oldxml == feed.xml
+ if first_run or (oldxml and oldxml == feed.xml)
debug "xml for #{feed} didn't change"
failures -= 1 if failures > 0
else