Avoid changing interface for password support

This commit is contained in:
tj 2010-09-29 09:52:43 +02:00
parent 95eedcedd3
commit 9fa6bbdeca
2 changed files with 4 additions and 5 deletions

7
irc.go
View File

@ -156,13 +156,13 @@ func (i *IRCConnection) Connect(server string) os.Error {
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)
if len(i.Password) > 0 {
i.pwrite <- fmt.Sprintf("PASS %s\r\n", i.Password)
}
return nil
}
func IRC(nick, user, password string) *IRCConnection {
func IRC(nick, user string) *IRCConnection {
irc := new(IRCConnection)
irc.registered = false
irc.pread = make(chan string, 100)
@ -170,7 +170,6 @@ func IRC(nick, user, password string) *IRCConnection {
irc.Error = make(chan os.Error)
irc.nick = nick
irc.user = user
irc.password = password
irc.setupCallbacks()
return irc
}

View File

@ -18,7 +18,7 @@ type IRCConnection struct {
user string
registered bool
server string
password string
Password string
events map[string][]func(*IRCEvent)
lastMessage int64