From f829eeab9b8c74b1d1762b165247f2bcceb5848b Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Wed, 3 Nov 2010 23:46:58 +0000 Subject: [PATCH] Merge in some other niceties from raylu. --- irc/connection.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/irc/connection.go b/irc/connection.go index e30160b..2e00a81 100644 --- a/irc/connection.go +++ b/irc/connection.go @@ -133,10 +133,14 @@ func (conn *Conn) Connect(host string, ssl bool, pass ...string) os.Error { } // dispatch a nicely formatted os.Error to the error channel -func (conn *Conn) error(s string, a ...interface{}) { conn.Err <- os.NewError(fmt.Sprintf(s, a)) } +func (conn *Conn) error(s string, a ...interface{}) { + conn.Err <- os.NewError(fmt.Sprintf(s, a...)) +} // copied from http.client for great justice -func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") } +func hasPort(s string) bool { + return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") +} // dispatch input from channel as \r\n terminated line to peer // flood controlled using hybrid's algorithm if conn.Flood is true @@ -216,7 +220,7 @@ func (conn *Conn) recv() { if len(args) > 1 { line.Text = args[1] } - args = strings.Split(args[0], " ", -1) + args = strings.Fields(args[0]) line.Cmd = strings.ToUpper(args[0]) if len(args) > 1 { line.Args = args[1:len(args)]