From 9fa6bbdecad6111a93c7b2902d147138ea0d4747 Mon Sep 17 00:00:00 2001 From: tj Date: Wed, 29 Sep 2010 09:52:43 +0200 Subject: [PATCH] Avoid changing interface for password support --- irc.go | 7 +++---- irc_struct.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/irc.go b/irc.go index dba5ef0..e11626c 100644 --- a/irc.go +++ b/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 } diff --git a/irc_struct.go b/irc_struct.go index 79e2e74..e0b9a07 100644 --- a/irc_struct.go +++ b/irc_struct.go @@ -18,7 +18,7 @@ type IRCConnection struct { user string registered bool server string - password string + Password string events map[string][]func(*IRCEvent) lastMessage int64