summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorDmitry Kim <dmitry point kim at gmail point com>2007-09-21 03:39:13 +0000
committerDmitry Kim <dmitry point kim at gmail point com>2007-09-21 03:39:13 +0000
commit30a021e7af0d9abf50df40acc0ab021880b872e9 (patch)
treee33f7e833f8382d05b768f3de144daddbc1bd149 /data
parentc7c93084ffa27adb2bff30b8c177ce973f83da05 (diff)
* (plugins/url) url.display_link_info now also applies for error messages
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/url.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/data/rbot/plugins/url.rb b/data/rbot/plugins/url.rb
index 524b0858..9cd73736 100644
--- a/data/rbot/plugins/url.rb
+++ b/data/rbot/plugins/url.rb
@@ -120,19 +120,21 @@ class UrlPlugin < Plugin
next unless urlstr =~ /^https?:/
title = nil
debug "Getting title for #{urlstr}..."
+ reply = nil
begin
title = get_title_for_url(urlstr,
:nick => m.source.nick,
:channel => m.channel,
:ircline => m.message)
debug "Title #{title ? '' : 'not '} found"
+ reply = "#{LINK_INFO} #{title}" if title
rescue => e
- m.reply "Error #{e.message}"
+ reply = "Error #{e.message}"
end
if display_info > urls_displayed
- if title
- m.reply("#{LINK_INFO} #{title}", :overlong => :truncate)
+ if reply
+ m.reply(reply, :overlong => :truncate)
urls_displayed += 1
end
end