rfc1459 compliance: PASS before NICK/USER

This commit is contained in:
lye 2012-03-20 23:11:35 -05:00
parent 07b619e8f2
commit d544994641

7
irc.go
View File

@ -173,14 +173,17 @@ func (i *IRCConnection) postConnect() error {
i.Error = make(chan error, 10)
i.syncreader = make(chan bool)
i.syncwriter = make(chan bool)
go reader(i)
go writer(i)
go pinger(i)
i.pwrite <- fmt.Sprintf("NICK %s\r\n", i.nick)
i.pwrite <- fmt.Sprintf("USER %s 0.0.0.0 0.0.0.0 :%s\r\n", i.user, i.user)
if len(i.Password) > 0 {
i.pwrite <- fmt.Sprintf("PASS %s\r\n", i.Password)
}
i.pwrite <- fmt.Sprintf("NICK %s\r\n", i.nick)
i.pwrite <- fmt.Sprintf("USER %s 0.0.0.0 0.0.0.0 :%s\r\n", i.user, i.user)
return nil
}