From 3893a035be347a7687a41d2054dd1b274d3a0504 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 12 Dec 2021 00:05:15 +0100 Subject: Update dependencies/vendor (#1659) --- .../github.com/matterbridge/matterclient/matterclient.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/matterbridge/matterclient') 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: -- cgit v1.2.3