diff options
author | Wim <wim@42.be> | 2020-10-21 01:14:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 01:14:13 +0200 |
commit | 4f8b19c6866ae61c2ca36b7c9935669ee2089ef2 (patch) | |
tree | aefe2c3934f7e6f98f764c3840a56059075e431f /bridge | |
parent | 84ab223b8196b70cc43ee3c60c868073d7a850d5 (diff) | |
download | matterbridge-msglm-4f8b19c6866ae61c2ca36b7c9935669ee2089ef2.tar.gz matterbridge-msglm-4f8b19c6866ae61c2ca36b7c9935669ee2089ef2.tar.bz2 matterbridge-msglm-4f8b19c6866ae61c2ca36b7c9935669ee2089ef2.zip |
Add PingDelay option (irc) (#1269)
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/irc/irc.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 2ac678e0..4be15b51 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -246,6 +246,13 @@ func (b *Birc) getClient() (*girc.Client, error) { debug = b.Log.Writer() } + pingDelay, err := time.ParseDuration(b.GetString("pingdelay")) + if err != nil || pingDelay == 0 { + pingDelay = time.Minute + } + + b.Log.Debugf("setting pingdelay to %s", pingDelay) + i := girc.New(girc.Config{ Server: server, ServerPass: b.GetString("Password"), @@ -255,7 +262,7 @@ func (b *Birc) getClient() (*girc.Client, error) { Name: b.GetString("Nick"), SSL: b.GetBool("UseTLS"), TLSConfig: &tls.Config{InsecureSkipVerify: b.GetBool("SkipTLSVerify"), ServerName: server}, //nolint:gosec - PingDelay: time.Minute, + PingDelay: pingDelay, // skip gIRC internal rate limiting, since we have our own throttling AllowFlood: true, Debug: debug, |