diff options
author | Wim <wim@42.be> | 2021-12-12 00:05:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-12 00:05:15 +0100 |
commit | 3893a035be347a7687a41d2054dd1b274d3a0504 (patch) | |
tree | dfe4a3bf72a0a6356e51bd8fc2e88e9a26e52331 /vendor/github.com/matterbridge/matterclient/matterclient.go | |
parent | 658bdd9faa835660ae407331732e9d93d8f6443b (diff) | |
download | matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.tar.gz matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.tar.bz2 matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.zip |
Update dependencies/vendor (#1659)
Diffstat (limited to 'vendor/github.com/matterbridge/matterclient/matterclient.go')
-rw-r--r-- | vendor/github.com/matterbridge/matterclient/matterclient.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/vendor/github.com/matterbridge/matterclient/matterclient.go b/vendor/github.com/matterbridge/matterclient/matterclient.go index a32219fe..3a89e141 100644 --- a/vendor/github.com/matterbridge/matterclient/matterclient.go +++ b/vendor/github.com/matterbridge/matterclient/matterclient.go @@ -71,6 +71,7 @@ type Client struct { WsConnected bool OnWsConnect func() reconnectBusy bool + Timeout int logger *logrus.Entry rootLogger *logrus.Logger @@ -80,6 +81,8 @@ type Client struct { lastPong time.Time } +var Matterircd bool + func New(login string, pass string, team string, server string, mfatoken string) *Client { rootLogger := logrus.New() rootLogger.SetFormatter(&prefixed.TextFormatter{ @@ -229,7 +232,12 @@ func (m *Client) initClient(b *backoff.Backoff) error { }, Proxy: http.ProxyFromEnvironment, } - m.Client.HTTPClient.Timeout = time.Second * 10 + + if m.Timeout == 0 { + m.Timeout = 10 + } + + m.Client.HTTPClient.Timeout = time.Second * time.Duration(m.Timeout) // handle MMAUTHTOKEN and personal token if err := m.handleLoginToken(); err != nil { @@ -613,7 +621,9 @@ func (m *Client) WsReceiver(ctx context.Context) { Team: m.Credentials.Team, } - m.parseMessage(msg) + if !Matterircd { + m.parseMessage(msg) + } m.MessageChan <- msg case response := <-m.WsClient.ResponseChannel: |