From e6558c5cd4181e0ab2247b08fc9bfb4602610e00 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 18 Sep 2007 07:05:48 +0000 Subject: [PATCH] HTML processing refactoring: url plugin: only add encoding and size information to pages with title if url.first_par is true --- data/rbot/plugins/url.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/rbot/plugins/url.rb b/data/rbot/plugins/url.rb index 7a752ec6..c4fce2ae 100644 --- a/data/rbot/plugins/url.rb +++ b/data/rbot/plugins/url.rb @@ -83,13 +83,13 @@ class UrlPlugin < Plugin extra << "#{Bold}type#{Bold}: #{resp['content-type']}" unless title if enc = resp['content-encoding'] logopts[:extra] << ", encoding: #{enc}" - extra << "#{Bold}encoding#{Bold}: #{enc}" + extra << "#{Bold}encoding#{Bold}: #{enc}" if @bot.config['url.first_par'] or not title end size = resp['content-length'].first.gsub(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/,'\1,\2') rescue nil if size logopts[:extra] << ", size: #{size} bytes" - extra << "#{Bold}size#{Bold}: #{size} bytes" + extra << "#{Bold}size#{Bold}: #{size} bytes" if @bot.config['url.first_par'] or not title end end rescue Exception => e -- 2.39.5