summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lrstanley/girc/conn.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-02-16 17:24:04 +0100
committerGitHub <noreply@github.com>2019-02-16 17:24:04 +0100
commit312369586925e0419271df7466e9b40756738f89 (patch)
tree247b181b64cd589afa3ab865058f47d26db662ea /vendor/github.com/lrstanley/girc/conn.go
parent777af73e2bafc0b2c6e1d1eaa554106efec36a70 (diff)
downloadmatterbridge-msglm-312369586925e0419271df7466e9b40756738f89.tar.gz
matterbridge-msglm-312369586925e0419271df7466e9b40756738f89.tar.bz2
matterbridge-msglm-312369586925e0419271df7466e9b40756738f89.zip
Upgrade to latest girc version (irc) (#718)
Diffstat (limited to 'vendor/github.com/lrstanley/girc/conn.go')
-rw-r--r--vendor/github.com/lrstanley/girc/conn.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/github.com/lrstanley/girc/conn.go b/vendor/github.com/lrstanley/girc/conn.go
index d0579815..d9ec6319 100644
--- a/vendor/github.com/lrstanley/girc/conn.go
+++ b/vendor/github.com/lrstanley/girc/conn.go
@@ -309,17 +309,17 @@ func (c *Client) internalConnect(mock net.Conn, dialer Dialer) error {
c.Config.Name = c.Config.User
}
- c.write(&Event{Command: USER, Params: []string{c.Config.User, "*", "*"}, Trailing: c.Config.Name})
+ c.write(&Event{Command: USER, Params: []string{c.Config.User, "*", "*", c.Config.Name}})
// Send a virtual event allowing hooks for successful socket connection.
- c.RunHandlers(&Event{Command: INITIALIZED, Trailing: c.Server()})
+ c.RunHandlers(&Event{Command: INITIALIZED, Params: []string{c.Server()}})
// Wait for the first error.
var result error
select {
case <-ctx.Done():
c.debug.Print("received request to close, beginning clean up")
- c.RunHandlers(&Event{Command: CLOSED, Trailing: c.Server()})
+ c.RunHandlers(&Event{Command: CLOSED, Params: []string{c.Server()}})
case err := <-errs:
c.debug.Print("received error, beginning clean up")
result = err
@@ -336,7 +336,7 @@ func (c *Client) internalConnect(mock net.Conn, dialer Dialer) error {
c.conn.mu.Unlock()
c.mu.RUnlock()
- c.RunHandlers(&Event{Command: DISCONNECTED, Trailing: c.Server()})
+ c.RunHandlers(&Event{Command: DISCONNECTED, Params: []string{c.Server()}})
// Once we have our error/result, let all other functions know we're done.
c.debug.Print("waiting for all routines to finish")
@@ -396,9 +396,9 @@ func (c *Client) Send(event *Event) {
<-time.After(c.conn.rate(event.Len()))
}
- if c.Config.GlobalFormat && event.Trailing != "" &&
+ if c.Config.GlobalFormat && len(event.Params) > 0 && event.Params[len(event.Params)-1] != "" &&
(event.Command == PRIVMSG || event.Command == TOPIC || event.Command == NOTICE) {
- event.Trailing = Fmt(event.Trailing)
+ event.Params[len(event.Params)-1] = Fmt(event.Params[len(event.Params)-1])
}
c.write(event)