Avoid changing interface for password support
This commit is contained in:
parent
95eedcedd3
commit
9fa6bbdeca
7
irc.go
7
irc.go
@ -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
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ type IRCConnection struct {
|
||||
user string
|
||||
registered bool
|
||||
server string
|
||||
password string
|
||||
Password string
|
||||
events map[string][]func(*IRCEvent)
|
||||
|
||||
lastMessage int64
|
||||
|
Loading…
Reference in New Issue
Block a user