]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
rss plugin: don't fail when feed.last_success is nil
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 18 Nov 2010 15:08:19 +0000 (16:08 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 18 Nov 2010 15:08:19 +0000 (16:08 +0100)
The first_run check comparing the time delta from last success failed
when feed.last_success was nil. Prevent this from happening by checking
if we are on the first run before the rest of the checks.

data/rbot/plugins/rss.rb

index ea8b096caa827008739f894aa3a8b82f30cb7c01..3b09930ab723539cf05197c51612268ea5759149 100644 (file)
@@ -928,7 +928,7 @@ class RSSFeedsPlugin < Plugin
         debug "fetching #{feed}"
 
         first_run = !feed.last_success
-        if (@bot.config['rss.announce_timeout'] > 0 &&
+        if (!first_run && @bot.config['rss.announce_timeout'] > 0 &&
            (Time.now - feed.last_success > @bot.config['rss.announce_timeout']))
           debug "#{feed} wasn't polled for too long, supressing output"
           first_run = true