]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/rss.rb
echo must default to false
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / rss.rb
index 03bb0b42038e2c0dbb27a09a77c99a82a60b1d45..7313f252236d2507691fa075d64b834bf477b9a6 100644 (file)
@@ -70,6 +70,8 @@ class ::RssBlob
     if watched_by?(who)\r
       return nil\r
     end\r
+    # TODO FIXME? should we just store watchers as Strings instead?\r
+    # This should then be @watchers << who.downcase\r
     @watchers << who\r
     return who\r
   end\r
@@ -106,7 +108,7 @@ class RSSFeedsPlugin < Plugin
 \r
   BotConfig.register BotConfigIntegerValue.new('rss.thread_sleep',\r
     :default => 300, :validate => Proc.new{|v| v > 30},\r
-    :desc => "How many characters to use of a RSS item text")\r
+    :desc => "How many seconds to sleep before checking RSS feeds again")\r
 \r
   @@watchThreads = Hash.new\r
   @@mutex = Mutex.new\r
@@ -122,6 +124,10 @@ class RSSFeedsPlugin < Plugin
     rewatch_rss\r
   end\r
 \r
+  def name\r
+    "rss"\r
+  end\r
+\r
   def watchlist\r
     @feeds.select { |h, f| f.watched? }\r
   end\r
@@ -418,7 +424,8 @@ class RSSFeedsPlugin < Plugin
               }\r
               if dispItems.length > 0\r
                 debug "Found #{dispItems.length} new items in #{feed}"\r
-                dispItems.each { |item|\r
+                # When displaying watched feeds, publish them from older to newer\r
+                dispItems.reverse.each { |item|\r
                   @@mutex.synchronize {\r
                     printFormattedRss(feed, item)\r
                   }\r