summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam James <atj@pulsewidth.org.uk>2008-03-04 17:04:09 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-03-04 18:06:48 +0100
commit3cdc485069b006174d383e735b54c4a9b7a24b3e (patch)
tree84912fe5370eef5d2c5ace5fb094a3e9b81ebbd5
parent71f81ee086db58b94b69d3e4082cbadec1b7c245 (diff)
rss plugin: make displaying links from the text of a feed item configurable
-rw-r--r--data/rbot/plugins/rss.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index 5baf43ee..8e8cb29c 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -265,6 +265,10 @@ class RSSFeedsPlugin < Plugin
:default => true,
:desc => "Whether feed items for which the description was changed should be shown as new")
+ Config.register Config::BooleanValue.new('rss.show_links',
+ :default => true,
+ :desc => "Whether to display links from the text of a feed item.")
+
# We used to save the Mutex with the RssBlob, which was idiotic. And
# since Mutexes dumped in one version might not be resotrable in another,
# we need a few tricks to be able to restore data from other versions of Ruby
@@ -879,10 +883,9 @@ class RSSFeedsPlugin < Plugin
title = "#{Bold}#{base_title.ircify_html(tit_opt)}#{Bold}"
end
- desc_opt = {
- :limit => @bot.config['rss.text_max'],
- :a_href => :link_out
- }
+ desc_opt = {}
+ desc_opt[:limit] = @bot.config['rss.text_max']
+ desc_opt[:a_href] = :link_out if @bot.config['rss.show_links']
# We prefer content_encoded here as it tends to provide more html formatting
# for use with ircify_html.