diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-08-21 20:34:22 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-08-21 20:34:22 +0200 |
commit | 235634f64decfd4c1c20574474faf0267c8772c5 (patch) | |
tree | c520ff55ec692ee4be359aabb51a9f2037dc8254 /data/rbot/plugins | |
parent | f6ec4e09d5d309f297b4ff6fd6c65ca82c74b462 (diff) |
geoip plugin: only retrieve host info once on WHOIS
Diffstat (limited to 'data/rbot/plugins')
-rwxr-xr-x | data/rbot/plugins/geoip.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/data/rbot/plugins/geoip.rb b/data/rbot/plugins/geoip.rb index 55fddcc9..96dcf9d2 100755 --- a/data/rbot/plugins/geoip.rb +++ b/data/rbot/plugins/geoip.rb @@ -82,12 +82,13 @@ class GeoIpPlugin < Plugin # need to see if the whois reply was invoked by this plugin return unless @stack.has_nick?(nick) + if m.target + msg = host2output(m.target.host, m.target.nick) + else + msg = "no such user on "+@bot.server.hostname.split(".")[-2] + end @stack[nick].each do |source| - if m.target - @bot.say source, host2output(m.target.host, m.target.nick) - else - @bot.say source, "no such user on "+@bot.server.hostname.split(".")[-2] - end + @bot.say source, msg end @stack.clear(nick) |