@@ -155,10 +155,15 @@ withReason: (OFString*)reason { [self sendLineWithFormat: @"KICK %@ %@ :%@", channel.name, user.nickname, reason]; } + +- (void)changeNicknameTo: (OFString*)nickname_ +{ + [self sendLineWithFormat: @"NICK %@", nickname_]; +} - (void)handleConnection { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFString *line; @@ -335,10 +340,15 @@ of_range(1, who.length - 1)]; newNickname = [newNickname substringWithRange: of_range(1, newNickname.length - 1)]; user = [IRCUser IRCUserWithString: who]; + + if ([user.nickname isEqual: nickname]) { + [nickname release]; + nickname = [user.nickname copy]; + } if ([delegate respondsToSelector: @selector(connection:didSeeUser:changeNicknameTo:)]) [delegate connection: self didSeeUser: user