diff options
Diffstat (limited to 'vendor/github.com/matterbridge')
-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: |