]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/rfc2812.rb
Lots of fixes all around, in preparation for the new auth coremodule
[user/henk/code/ruby/rbot.git] / lib / rbot / rfc2812.rb
index e2438210ad735ffa957e439ff80d7c01b20affee..697c13e95a9fa15db7f5e55c2bb8c85e4235c88c 100644 (file)
@@ -922,6 +922,7 @@ module Irc
             data[:nick] = $2
             data[:address] = $3
             @client = @server.user(data[:netmask])
+            set = true
           when /Welcome to the Internet Relay Network\s(\S+)/
             data[:nick] = $1
           when /Welcome.*\s+(\S+)$/
@@ -929,7 +930,7 @@ module Irc
           when /^(\S+)$/
             data[:nick] = $1
           end
-          @user ||= @server.user(data[:nick])
+          @client = @server.user(data[:nick]) unless set
           handle(:welcome, data)
         when RPL_YOURHOST
           # "Your host is <servername>, running version <ver>"
@@ -1016,7 +1017,7 @@ module Irc
 
           users.each { |ar|
             u = @server.user(ar[0])
-            chan.users << u
+            chan.users << u unless chan.users.include?(u)
             if ar[1]
               m = @server.supports[:prefix][:prefixes].index(ar[1].to_sym)
               m = @server.supports[:prefix][:modes][m]