From 30a021e7af0d9abf50df40acc0ab021880b872e9 Mon Sep 17 00:00:00 2001 From: Dmitry Kim Date: Fri, 21 Sep 2007 03:39:13 +0000 Subject: * (plugins/url) url.display_link_info now also applies for error messages --- data/rbot/plugins/url.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'data/rbot/plugins/url.rb') 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 -- cgit v1.2.3