kunt

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

commit a9ab4724a5b2c5ecafdb0a805f51edae5ef4f822
parent 743755dffd7f149781d5c6f52d6b2f232252ad80
Author: sin <sin@2f30.org>
Date:   Tue May  7 21:46:21 +0100

update irc handling

Diffstat:
src/irc/irc.go | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/irc/irc.go b/src/irc/irc.go @@ -196,13 +196,15 @@ func (i *IrcContext) RxRawMessages() error { if err != nil { return err } - fmt.Println(string(buf[0 : n-1])) - s := string(buf[0:n]) + if n != 0 { + fmt.Println(string(buf[0 : n-1])) + s := string(buf[0:n]) - msg := i.ParseRawMessage(s) - i.incomingMsg <- msg - for _, v := range i.intercepts { - *v <- msg + msg := i.ParseRawMessage(s) + i.incomingMsg <- msg + for _, v := range i.intercepts { + *v <- msg + } } } return nil