From 5f75f9886d4458c5b08ae7f98a20f85415c3d706 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 25 Mar 2022 22:01:02 +0100 Subject: [PATCH] Update lrstanley/girc dep (#1773) --- go.mod | 2 +- go.sum | 10 +++++----- vendor/github.com/lrstanley/girc/README.md | 16 +++++----------- vendor/github.com/lrstanley/girc/builtin.go | 2 +- vendor/github.com/lrstanley/girc/cap.go | 2 +- vendor/github.com/lrstanley/girc/cap_sasl.go | 1 - vendor/github.com/lrstanley/girc/conn.go | 10 +++++----- vendor/github.com/lrstanley/girc/constants.go | 1 + vendor/github.com/lrstanley/girc/event.go | 4 +--- vendor/github.com/lrstanley/girc/handler.go | 1 - vendor/modules.txt | 2 +- 11 files changed, 21 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index edb70a5d..a1697260 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/keybase/go-keybase-chat-bot v0.0.0-20211201215354-ee4b23828b55 github.com/kyokomi/emoji/v2 v2.2.9 github.com/labstack/echo/v4 v4.7.0 - github.com/lrstanley/girc v0.0.0-20211023233735-147f0ff77566 + github.com/lrstanley/girc v0.0.0-20220321215535-9664730c7858 github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20211016222428-79310a412696 github.com/matterbridge/go-xmpp v0.0.0-20211030125215-791a06c5f1be github.com/matterbridge/gomatrix v0.0.0-20220205235239-607eb9ee6419 diff --git a/go.sum b/go.sum index 5bd03002..1d3ebd64 100644 --- a/go.sum +++ b/go.sum @@ -1053,8 +1053,8 @@ github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lrstanley/girc v0.0.0-20211023233735-147f0ff77566 h1:tseAo8DbdhZa+PLuJW0p/P8b7I9LUiVpIpboAHkLsoM= -github.com/lrstanley/girc v0.0.0-20211023233735-147f0ff77566/go.mod h1:liX5MxHPrwgHaKowoLkYGwbXfYABh1jbZ6FpElbGF1I= +github.com/lrstanley/girc v0.0.0-20220321215535-9664730c7858 h1:IIbHCRHuANbPoQymk4BWGcRI47RXHOt7bDxPbxQ9rms= +github.com/lrstanley/girc v0.0.0-20220321215535-9664730c7858/go.mod h1:liX5MxHPrwgHaKowoLkYGwbXfYABh1jbZ6FpElbGF1I= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -1171,12 +1171,12 @@ github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= diff --git a/vendor/github.com/lrstanley/girc/README.md b/vendor/github.com/lrstanley/girc/README.md index 35f3d818..62f26a76 100644 --- a/vendor/github.com/lrstanley/girc/README.md +++ b/vendor/github.com/lrstanley/girc/README.md @@ -1,26 +1,20 @@ -

+

girc, a flexible IRC library for Go

- Build Status + Test Status Coverage Status - GoDoc + GoDoc Go Report Card - IRC Chat + Community Chat

-## Status - -**girc is fairly close to marking the 1.0.0 endpoint, which will be tagged as -necessary, so you will be able to use this with care knowing the specific tag -you're using won't have breaking changes** - ## Features - Focuses on simplicity, yet tries to still be flexible. - Only requires [standard library packages](https://godoc.org/github.com/lrstanley/girc?imports) - Event based triggering/responses ([example](https://godoc.org/github.com/lrstanley/girc#ex-package--Commands), and [CTCP too](https://godoc.org/github.com/lrstanley/girc#Commands.SendCTCP)!) - [Documentation](https://godoc.org/github.com/lrstanley/girc) is _mostly_ complete. -- Support for almost all of the [IRCv3 spec](http://ircv3.net/software/libraries.html). +- Support for a good portion of the [IRCv3 spec](http://ircv3.net/software/libraries.html). - SASL Auth (currently only `PLAIN` and `EXTERNAL` is support by default, however you can simply implement `SASLMech` yourself to support additional mechanisms.) diff --git a/vendor/github.com/lrstanley/girc/builtin.go b/vendor/github.com/lrstanley/girc/builtin.go index 081e9465..914b5fab 100644 --- a/vendor/github.com/lrstanley/girc/builtin.go +++ b/vendor/github.com/lrstanley/girc/builtin.go @@ -451,7 +451,7 @@ func handleNAMES(c *Client, e Event) { var modes, nick string var ok bool - s := &Source{} + var s *Source c.state.Lock() for i := 0; i < len(parts); i++ { diff --git a/vendor/github.com/lrstanley/girc/cap.go b/vendor/github.com/lrstanley/girc/cap.go index 38ff210c..dcf53f0e 100644 --- a/vendor/github.com/lrstanley/girc/cap.go +++ b/vendor/github.com/lrstanley/girc/cap.go @@ -106,7 +106,7 @@ func parseCap(raw string) map[string]map[string]string { if j < 0 { out[parts[i][:val]][option] = "" } else { - out[parts[i][:val]][option[:j]] = option[j+1 : len(option)] + out[parts[i][:val]][option[:j]] = option[j+1:] } } } diff --git a/vendor/github.com/lrstanley/girc/cap_sasl.go b/vendor/github.com/lrstanley/girc/cap_sasl.go index 9aecccf3..d880316b 100644 --- a/vendor/github.com/lrstanley/girc/cap_sasl.go +++ b/vendor/github.com/lrstanley/girc/cap_sasl.go @@ -120,7 +120,6 @@ func handleSASL(c *Client, e Event) { break } } - return } func handleSASLError(c *Client, e Event) { diff --git a/vendor/github.com/lrstanley/girc/conn.go b/vendor/github.com/lrstanley/girc/conn.go index 441c3e71..b691403c 100644 --- a/vendor/github.com/lrstanley/girc/conn.go +++ b/vendor/github.com/lrstanley/girc/conn.go @@ -43,8 +43,7 @@ type ircConn struct { lastPing time.Time // lastPong is the last successful time that we pinged the server and // received a successful pong back. - lastPong time.Time - pingDelay time.Duration + lastPong time.Time } // Dialer is an interface implementation of net.Dialer. Use this if you would @@ -477,7 +476,7 @@ func (c *Client) write(event *Event) { func (c *ircConn) rate(chars int) time.Duration { _time := time.Second + ((time.Duration(chars) * time.Second) / 100) - if c.writeDelay += _time - time.Now().Sub(c.lastWrite); c.writeDelay < 0 { + if c.writeDelay += _time - time.Since(c.lastWrite); c.writeDelay < 0 { c.writeDelay = 0 } @@ -607,15 +606,16 @@ func (c *Client) pingLoop(ctx context.Context, errs chan error, wg *sync.WaitGro if time.Since(c.conn.lastPong) > c.Config.PingDelay+(60*time.Second) { // It's 60 seconds over what out ping delay is, connection // has probably dropped. - errs <- ErrTimedOut{ + err := ErrTimedOut{ TimeSinceSuccess: time.Since(c.conn.lastPong), LastPong: c.conn.lastPong, LastPing: c.conn.lastPing, Delay: c.Config.PingDelay, } - wg.Done() c.conn.mu.RUnlock() + errs <- err + wg.Done() return } c.conn.mu.RUnlock() diff --git a/vendor/github.com/lrstanley/girc/constants.go b/vendor/github.com/lrstanley/girc/constants.go index a190ef21..8f5f91b1 100644 --- a/vendor/github.com/lrstanley/girc/constants.go +++ b/vendor/github.com/lrstanley/girc/constants.go @@ -347,4 +347,5 @@ const ( RPL_LOCALUSERS = "265" // aircd/hybrid/bahamut, used on freenode. RPL_TOPICWHOTIME = "333" // ircu, used on freenode. RPL_WHOSPCRPL = "354" // ircu, used on networks with WHOX support. + RPL_CREATIONTIME = "329" ) diff --git a/vendor/github.com/lrstanley/girc/event.go b/vendor/github.com/lrstanley/girc/event.go index 423e452b..3eb187f9 100644 --- a/vendor/github.com/lrstanley/girc/event.go +++ b/vendor/github.com/lrstanley/girc/event.go @@ -13,7 +13,7 @@ import ( const ( eventSpace byte = ' ' // Separator. - maxLength = 510 // Maximum length is 510 (2 for line endings). + maxLength int = 510 // Maximum length is 510 (2 for line endings). ) // cutCRFunc is used to trim CR characters from prefixes/messages. @@ -636,6 +636,4 @@ func (s *Source) writeTo(buffer *bytes.Buffer) { buffer.WriteByte(prefixHost) buffer.WriteString(s.Host) } - - return } diff --git a/vendor/github.com/lrstanley/girc/handler.go b/vendor/github.com/lrstanley/girc/handler.go index 4832262a..712886b3 100644 --- a/vendor/github.com/lrstanley/girc/handler.go +++ b/vendor/github.com/lrstanley/girc/handler.go @@ -458,7 +458,6 @@ func recoverHandlerPanic(client *Client, event *Event, id string, skip int) { } client.Config.RecoverFunc(client, err) - return } // HandlerError is the error returned when a panic is intentionally recovered diff --git a/vendor/modules.txt b/vendor/modules.txt index eb282720..cdd524b2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -190,7 +190,7 @@ github.com/labstack/gommon/bytes github.com/labstack/gommon/color github.com/labstack/gommon/log github.com/labstack/gommon/random -# github.com/lrstanley/girc v0.0.0-20211023233735-147f0ff77566 +# github.com/lrstanley/girc v0.0.0-20220321215535-9664730c7858 ## explicit; go 1.12 github.com/lrstanley/girc # github.com/magiconair/properties v1.8.5