kunt

golang IRC bot
git clone git://git.2f30.org/kunt
Log | Files | Refs | LICENSE

commit 209ecc402ecaeb40ab323da7c0f05d369e43368b
parent cdcb367aba9d786d833d4153987fdb3c46172dee
Author: sin <sin@2f30.org>
Date:   Thu, 30 May 2013 12:08:07 +0100

join channel regardless

Diffstat:
Msrc/irc/irc.go | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/irc/irc.go b/src/irc/irc.go @@ -115,7 +115,7 @@ func MakeChanIter(i *Context) ChanIter { } } -func (i *Context) JoinChannel(c string, key string) error { +func (i *Context) JoinChannel(c string, key string) { i.Lock() defer i.Unlock() found := false @@ -136,12 +136,13 @@ func (i *Context) JoinChannel(c string, key string) error { if !v.joined { i.Join(v.name, v.key) i.network.channels[j].joined = true - return nil + break } else { - return fmt.Errorf("Already joined channel %s", c) + i.Join(v.name, v.key) + break } } - return nil + return } func (i *Context) PartChannel(s string, text string) error {