]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
geoip plugin: only retrieve host info once on WHOIS
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 21 Aug 2008 18:34:22 +0000 (20:34 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 21 Aug 2008 18:34:22 +0000 (20:34 +0200)
data/rbot/plugins/geoip.rb

index 55fddcc9992ea59a7e80f65be9ea4eeb0e3c5f8d..96dcf9d23ce2edca1ef62317ad511a1939686d92 100755 (executable)
@@ -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)