Update dependencies (#2007)

* Update dependencies
This commit is contained in:
Wim
2023-03-09 22:48:00 +01:00
committed by GitHub
parent d5f9cdf912
commit 08779c2909
345 changed files with 151040 additions and 125983 deletions

View File

@@ -79,7 +79,10 @@ func (cli *Client) handleIB(node *waBinary.Node) {
func (cli *Client) handleConnectFailure(node *waBinary.Node) {
ag := node.AttrGetter()
reason := events.ConnectFailureReason(ag.Int("reason"))
cli.expectDisconnect()
// Let the auto-reconnect happen for 503s, for all other failures block it
if reason != events.ConnectFailureServiceUnavailable {
cli.expectDisconnect()
}
if reason.IsLoggedOut() {
cli.Log.Infof("Got %s connect failure, sending LoggedOut event and deleting session", reason)
go cli.dispatchEvent(&events.LoggedOut{OnConnect: true, Reason: reason})
@@ -96,6 +99,8 @@ func (cli *Client) handleConnectFailure(node *waBinary.Node) {
} else if reason == events.ConnectFailureClientOutdated {
cli.Log.Errorf("Client outdated (405) connect failure")
go cli.dispatchEvent(&events.ClientOutdated{})
} else if reason == events.ConnectFailureServiceUnavailable {
cli.Log.Warnf("Got 503 connect failure, assuming automatic reconnect will handle it")
} else {
cli.Log.Warnf("Unknown connect failure: %s", node.XMLString())
go cli.dispatchEvent(&events.ConnectFailure{Reason: reason, Raw: node})