]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/ircbot.rb
fix nick renaming during connection
[user/henk/code/ruby/rbot.git] / lib / rbot / ircbot.rb
index ddbc6eb6f28fcb6c3e060e90b6a9790ad7ce0679..b039e05d02d6dff13a0eb49e1b1678798d565c5b 100644 (file)
@@ -50,6 +50,7 @@ require 'rbot/registry'
 require 'rbot/plugins'
 require 'rbot/message'
 require 'rbot/language'
+require 'rbot/httputil'
 
 module Irc
 
@@ -471,6 +472,7 @@ class Bot
 
     @plugins = nil
     @lang = Language.new(self, @config['core.language'])
+    @httputil = Utils::HttpUtil.new(self)
 
     begin
       @auth = Auth::manager
@@ -582,7 +584,7 @@ class Bot
       # to inform us that our nick has been changed.
       if data[:target] == '*'
         debug "setting my connection nick to #{new}"
-        nick = new
+        @client.user.nick = new
       end
       @plugins.delegate "nicktaken", data[:nick]
     }
@@ -1236,6 +1238,7 @@ class Bot
           debug "\tignoring cleanup error: #{$!}"
         end
       end
+      @httputil.cleanup
       # debug "\tstopping timers ..."
       # @timer.stop
       # debug "Closing registries"