From 77529609e2c384071879d1c3f1f8288068bd247f Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 18 Feb 2007 10:10:17 +0000 Subject: More fixes for nickname handling on connection --- lib/rbot/rfc2812.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/rbot/rfc2812.rb') diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb index 1888f75f..cc7fd7e7 100644 --- a/lib/rbot/rfc2812.rb +++ b/lib/rbot/rfc2812.rb @@ -917,12 +917,12 @@ module Irc params.scan(/(?!:)(\S+)|:(.*)/) { argv << ($1 || $2) } if params if command =~ /^(\d+)$/ # Numeric replies - data[:nick] = argv[0] + data[:target] = argv[0] # A numeric reply /should/ be directed at the client, except when we're connecting with a used nick, in which case # it's directed at '*' - not_us = !([@client.nick, '*'].include?(data[:nick])) + not_us = !([@client.nick, '*'].include?(data[:target])) if not_us - warning "Server reply #{serverstring.inspect} directed at #{data[:nick]} instead of client (#{@client.nick})" + warning "Server reply #{serverstring.inspect} directed at #{data[:target]} instead of client (#{@client.nick})" end num=command.to_i @@ -932,13 +932,13 @@ module Irc # !@" if not_us warning "Server thinks client (#{@client.inspect}) has a different nick" - @client.nick = data[:nick] + @client.nick = data[:target] end if argv[1] =~ /(\S+)(?:!(\S+?))?@(\S+)/ nick = $1 user = $2 host = $2 - warning "Welcome message nick mismatch (#{nick} vs #{data[:nick]})" if nick != data[:nick] + warning "Welcome message nick mismatch (#{nick} vs #{data[:target]})" if nick != data[:target] @client.user = user if user @client.host = host if host end -- cgit v1.2.3