]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
rss plugin: make displaying links from the text of a feed item configurable
authorAdam James <atj@pulsewidth.org.uk>
Tue, 4 Mar 2008 17:04:09 +0000 (17:04 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 4 Mar 2008 17:06:48 +0000 (18:06 +0100)
data/rbot/plugins/rss.rb

index 5baf43ee60eb27af4f8ef6f9dd362cd1899ec983..8e8cb29c9aad6888063609bfbcbff048b3b22652 100644 (file)
@@ -265,6 +265,10 @@ class RSSFeedsPlugin < Plugin
     :default => true,\r
     :desc => "Whether feed items for which the description was changed should be shown as new")\r
 \r
+  Config.register Config::BooleanValue.new('rss.show_links',\r
+    :default => true,\r
+    :desc => "Whether to display links from the text of a feed item.")\r
+\r
   # We used to save the Mutex with the RssBlob, which was idiotic. And\r
   # since Mutexes dumped in one version might not be resotrable in another,\r
   # we need a few tricks to be able to restore data from other versions of Ruby\r
@@ -879,10 +883,9 @@ class RSSFeedsPlugin < Plugin
       title = "#{Bold}#{base_title.ircify_html(tit_opt)}#{Bold}"\r
     end\r
 \r
-    desc_opt = {\r
-      :limit => @bot.config['rss.text_max'],\r
-      :a_href => :link_out\r
-    }\r
+    desc_opt = {}\r
+    desc_opt[:limit] = @bot.config['rss.text_max']\r
+    desc_opt[:a_href] = :link_out if @bot.config['rss.show_links']\r
 \r
     # We prefer content_encoded here as it tends to provide more html formatting \r
     # for use with ircify_html.\r