summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lrstanley/girc/conn.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-01-03 00:07:50 +0100
committerWim <wim@42.be>2019-01-03 00:07:50 +0100
commitd2044c647b2e57ec5d5a7684177cf5e2e3325714 (patch)
treec0cd092f4cb2bb528f455e33d7f989e8f3099b7b /vendor/github.com/lrstanley/girc/conn.go
parentc585d00f162cc244b381fcaaef7ac5b1efda2cf5 (diff)
downloadmatterbridge-msglm-d2044c647b2e57ec5d5a7684177cf5e2e3325714.tar.gz
matterbridge-msglm-d2044c647b2e57ec5d5a7684177cf5e2e3325714.tar.bz2
matterbridge-msglm-d2044c647b2e57ec5d5a7684177cf5e2e3325714.zip
Update vendor
* go-telegram-bot-api/telegram-bot-api * lrstanley/girc * matterbridge/gomatrix
Diffstat (limited to 'vendor/github.com/lrstanley/girc/conn.go')
-rw-r--r--vendor/github.com/lrstanley/girc/conn.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/vendor/github.com/lrstanley/girc/conn.go b/vendor/github.com/lrstanley/girc/conn.go
index 77d87988..d0579815 100644
--- a/vendor/github.com/lrstanley/girc/conn.go
+++ b/vendor/github.com/lrstanley/girc/conn.go
@@ -284,6 +284,11 @@ func (c *Client) internalConnect(mock net.Conn, dialer Dialer) error {
go c.pingLoop(ctx, errs, &wg)
// Passwords first.
+
+ if c.Config.WebIRC.Password != "" {
+ c.write(&Event{Command: WEBIRC, Params: c.Config.WebIRC.Params(), Sensitive: true})
+ }
+
if c.Config.ServerPass != "" {
c.write(&Event{Command: PASS, Params: []string{c.Config.ServerPass}, Sensitive: true})
}
@@ -314,7 +319,7 @@ func (c *Client) internalConnect(mock net.Conn, dialer Dialer) error {
select {
case <-ctx.Done():
c.debug.Print("received request to close, beginning clean up")
- c.RunHandlers(&Event{Command: STOPPED, Trailing: c.Server()})
+ c.RunHandlers(&Event{Command: CLOSED, Trailing: c.Server()})
case err := <-errs:
c.debug.Print("received error, beginning clean up")
result = err
@@ -331,6 +336,8 @@ 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()})
+
// Once we have our error/result, let all other functions know we're done.
c.debug.Print("waiting for all routines to finish")
@@ -374,7 +381,7 @@ func (c *Client) readLoop(ctx context.Context, errs chan error, wg *sync.WaitGro
// Check if it's an echo-message.
if !c.Config.disableTracking {
event.Echo = (event.Command == PRIVMSG || event.Command == NOTICE) &&
- event.Source != nil && event.Source.Name == c.GetNick()
+ event.Source != nil && event.Source.ID() == c.GetID()
}
c.rx <- event