Wait up to 3 seconds for encryption keys to arrive

This commit is contained in:
Tulir Asokan
2020-09-24 15:25:36 +03:00
parent 0b2fd69bf1
commit d67c3a8c96
8 changed files with 38 additions and 13 deletions

View File

@@ -18,6 +18,7 @@ package main
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"sort"
@@ -26,7 +27,6 @@ import (
"sync"
"time"
"github.com/pkg/errors"
"github.com/skip2/go-qrcode"
log "maunium.net/go/maulogger/v2"
@@ -683,7 +683,7 @@ func (user *User) updateLastConnectionIfNecessary() {
}
func (user *User) HandleError(err error) {
if errors.Cause(err) != whatsapp.ErrInvalidWsData {
if !errors.Is(err, whatsapp.ErrInvalidWsData) {
user.log.Errorfln("WhatsApp error: %v", err)
}
if closed, ok := err.(*whatsapp.ErrConnectionClosed); ok {