diff options
author | Wim <wim@42.be> | 2017-01-24 21:24:57 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-01-24 21:24:57 +0100 |
commit | 09b243d8c2b4276de268777d973ca618267db92c (patch) | |
tree | 917fbd8ff4e85faedb5d9052fa8e8fadecddd858 /vendor/github.com/thoj/go-ircevent/irc_callback.go | |
parent | 991183e5147f2d9078e8e88979ced1356d9d1796 (diff) | |
download | matterbridge-msglm-09b243d8c2b4276de268777d973ca618267db92c.tar.gz matterbridge-msglm-09b243d8c2b4276de268777d973ca618267db92c.tar.bz2 matterbridge-msglm-09b243d8c2b4276de268777d973ca618267db92c.zip |
Update vendor (irc)
Diffstat (limited to 'vendor/github.com/thoj/go-ircevent/irc_callback.go')
-rw-r--r-- | vendor/github.com/thoj/go-ircevent/irc_callback.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vendor/github.com/thoj/go-ircevent/irc_callback.go b/vendor/github.com/thoj/go-ircevent/irc_callback.go index b5622367..d389f731 100644 --- a/vendor/github.com/thoj/go-ircevent/irc_callback.go +++ b/vendor/github.com/thoj/go-ircevent/irc_callback.go @@ -136,9 +136,8 @@ func (irc *Connection) RunCallbacks(event *Event) { func (irc *Connection) setupCallbacks() { irc.events = make(map[string]map[int]func(*Event)) - //Handle error events. This has to be called in a new thred to allow - //readLoop to exit - irc.AddCallback("ERROR", func(e *Event) { go irc.Disconnect() }) + //Handle error events. + irc.AddCallback("ERROR", func(e *Event) { irc.Disconnect() }) //Handle ping events irc.AddCallback("PING", func(e *Event) { irc.SendRaw("PONG :" + e.Message()) }) @@ -201,7 +200,7 @@ func (irc *Connection) setupCallbacks() { ns, _ := strconv.ParseInt(e.Message(), 10, 64) delta := time.Duration(time.Now().UnixNano() - ns) if irc.Debug { - irc.Log.Printf("Lag: %vs\n", delta) + irc.Log.Printf("Lag: %.3f s\n", delta.Seconds()) } }) @@ -216,6 +215,8 @@ func (irc *Connection) setupCallbacks() { // 1: RPL_WELCOME "Welcome to the Internet Relay Network <nick>!<user>@<host>" // Set irc.nickcurrent to the actually used nick in this connection. irc.AddCallback("001", func(e *Event) { + irc.Lock() irc.nickcurrent = e.Arguments[0] + irc.Unlock() }) } |