diff --git a/irc/commands.go b/irc/commands.go index 8e2f589..5041bdd 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -124,7 +124,7 @@ func (conn *Conn) Mode(t string, modestring ...string) { func (conn *Conn) Away(message ...string) { msg := strings.Join(message, " ") if msg != "" { - msg = " :"+msg + msg = " :" + msg } conn.out <- "AWAY"+msg } diff --git a/irc/connection.go b/irc/connection.go index 35502b1..03669b7 100644 --- a/irc/connection.go +++ b/irc/connection.go @@ -14,8 +14,8 @@ import ( // encountered are piped down *Conn.Err; this channel is closed on disconnect. type Conn struct { // Connection Hostname and Nickname - Host string - Me *Nick + Host string + Me *Nick Network string // I/O stuff to server @@ -26,7 +26,7 @@ type Conn struct { connected bool // Are we connecting via SSL? Do we care about certificate validity? - SSL bool + SSL bool SSLConfig *tls.Config // Error channel to transmit any fail back to the user @@ -95,8 +95,8 @@ func (conn *Conn) initialise() { func (conn *Conn) Connect(host string, pass ...string) os.Error { if conn.connected { return os.NewError(fmt.Sprintf( - "irc.Connect(): already connected to %s, cannot connect to %s", - conn.Host, host)) + "irc.Connect(): already connected to %s, cannot connect to %s", + conn.Host, host)) } if conn.SSL { @@ -160,7 +160,7 @@ func hasPort(s string) bool { // flood controlled using hybrid's algorithm if conn.Flood is true func (conn *Conn) send() { lastsent := time.Nanoseconds() - var badness, linetime, second int64 = 0, 0, 1000000000; + var badness, linetime, second int64 = 0, 0, 1000000000 for line := range conn.out { // Hybrid's algorithm allows for 2 seconds per line and an additional // 1/120 of a second per character on that line. @@ -245,7 +245,7 @@ func (conn *Conn) recv() { func (conn *Conn) runLoop() { for line := range conn.in { - conn.dispatchEvent(line) + conn.dispatchEvent(line) } } diff --git a/irc/handlers.go b/irc/handlers.go index 5e91d65..aac3c2e 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -108,9 +108,9 @@ func (conn *Conn) setupEvents() { // XXX: do we need 005 protocol support message parsing here? // probably in the future, but I can't quite be arsed yet. /* - :irc.pl0rt.org 005 GoTest CMDS=KNOCK,MAP,DCCALLOW,USERIP UHNAMES NAMESX SAFELIST HCN MAXCHANNELS=20 CHANLIMIT=#:20 MAXLIST=b:60,e:60,I:60 NICKLEN=30 CHANNELLEN=32 TOPICLEN=307 KICKLEN=307 AWAYLEN=307 :are supported by this server - :irc.pl0rt.org 005 GoTest MAXTARGETS=20 WALLCHOPS WATCH=128 WATCHOPTS=A SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=beI,kfL,lj,psmntirRcOAQKVCuzNSMT NETWORK=bb101.net CASEMAPPING=ascii EXTBAN=~,cqnr ELIST=MNUCT :are supported by this server - :irc.pl0rt.org 005 GoTest STATUSMSG=~&@%+ EXCEPTS INVEX :are supported by this server + :irc.pl0rt.org 005 GoTest CMDS=KNOCK,MAP,DCCALLOW,USERIP UHNAMES NAMESX SAFELIST HCN MAXCHANNELS=20 CHANLIMIT=#:20 MAXLIST=b:60,e:60,I:60 NICKLEN=30 CHANNELLEN=32 TOPICLEN=307 KICKLEN=307 AWAYLEN=307 :are supported by this server + :irc.pl0rt.org 005 GoTest MAXTARGETS=20 WALLCHOPS WATCH=128 WATCHOPTS=A SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=beI,kfL,lj,psmntirRcOAQKVCuzNSMT NETWORK=bb101.net CASEMAPPING=ascii EXTBAN=~,cqnr ELIST=MNUCT :are supported by this server + :irc.pl0rt.org 005 GoTest STATUSMSG=~&@%+ EXCEPTS INVEX :are supported by this server */ // Handler to deal with "433 :Nickname already in use" diff --git a/irc/irc_test.go b/irc/irc_test.go index eba9ca6..68ade89 100644 --- a/irc/irc_test.go +++ b/irc/irc_test.go @@ -12,4 +12,3 @@ func TestIRC(t *testing.T) { t.FailNow() } } - diff --git a/irc/nickchan.go b/irc/nickchan.go index 382862c..04b182c 100644 --- a/irc/nickchan.go +++ b/irc/nickchan.go @@ -203,44 +203,44 @@ func (n *Nick) Delete() { // Map *irc.ChanMode fields to IRC mode characters var ChanModeToString = map[string]string{ - "Private": "p", - "Secret": "s", + "Private": "p", + "Secret": "s", "ProtectedTopic": "t", - "NoExternalMsg": "n", - "Moderated": "m", - "InviteOnly": "i", - "OperOnly": "O", - "SSLOnly": "z", - "Key": "k", - "Limit": "l", + "NoExternalMsg": "n", + "Moderated": "m", + "InviteOnly": "i", + "OperOnly": "O", + "SSLOnly": "z", + "Key": "k", + "Limit": "l", } // Map *irc.NickMode fields to IRC mode characters var NickModeToString = map[string]string{ - "Invisible": "i", - "Oper": "o", - "WallOps": "w", + "Invisible": "i", + "Oper": "o", + "WallOps": "w", "HiddenHost": "x", - "SSL": "z", + "SSL": "z", } // Map *irc.ChanPrivs fields to IRC mode characters var ChanPrivToString = map[string]string{ - "Owner": "q", - "Admin": "a", - "Op": "o", + "Owner": "q", + "Admin": "a", + "Op": "o", "HalfOp": "h", - "Voice": "v", + "Voice": "v", } // Map *irc.ChanPrivs fields to the symbols used to represent these modes // in NAMES and WHOIS responses var ChanPrivToModeChar = map[string]byte{ - "Owner": '~', - "Admin": '&', - "Op": '@', + "Owner": '~', + "Admin": '&', + "Op": '@', "HalfOp": '%', - "Voice": '+', + "Voice": '+', } // Reverse mappings of the above datastructures