Update go-whatsapp to handle query timeouts

This commit is contained in:
Tulir Asokan 2021-02-24 17:18:27 +02:00
parent 3b6d4322d6
commit 37c2a064a5
3 changed files with 11 additions and 5 deletions

6
go.mod
View file

@ -12,8 +12,8 @@ require (
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
gopkg.in/yaml.v2 v2.3.0
maunium.net/go/mauflag v1.0.0
maunium.net/go/maulogger/v2 v2.2.2
maunium.net/go/mautrix v0.8.3
maunium.net/go/maulogger/v2 v2.2.3
maunium.net/go/mautrix v0.8.4
)
replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.4.0-rc.1.0.20210223220427-1fc7fa00f13b
replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.4.0-rc.2

6
go.sum
View file

@ -299,6 +299,8 @@ github.com/tulir/go-whatsapp v0.4.0-rc.1.0.20210223153547-62454c3af2c8 h1:WVZyCG
github.com/tulir/go-whatsapp v0.4.0-rc.1.0.20210223153547-62454c3af2c8/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E=
github.com/tulir/go-whatsapp v0.4.0-rc.1.0.20210223220427-1fc7fa00f13b h1:oAcxqLVVaT5nzeB7P/Orlp4h4e9WaphcBUSTJgK0fDo=
github.com/tulir/go-whatsapp v0.4.0-rc.1.0.20210223220427-1fc7fa00f13b/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E=
github.com/tulir/go-whatsapp v0.4.0-rc.2 h1:fYTC2IFQhL5j/3JyRnlp6PTYmSEnbSrPQgmD6jWZdIo=
github.com/tulir/go-whatsapp v0.4.0-rc.2/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
@ -464,7 +466,11 @@ maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
maunium.net/go/maulogger/v2 v2.2.2 h1:NCw+7Be1GQFm8xXJ4M2C0Q8yLBTx3c5s7UZ4y1anZMU=
maunium.net/go/maulogger/v2 v2.2.2/go.mod h1:TYWy7wKwz/tIXTpsx8G3mZseIRiC5DoMxSZazOHy68A=
maunium.net/go/maulogger/v2 v2.2.3 h1:YnLoE/5ZHwr2nwXya0ik7ramRxMs/Gc934dmj1KrPvs=
maunium.net/go/maulogger/v2 v2.2.3/go.mod h1:TYWy7wKwz/tIXTpsx8G3mZseIRiC5DoMxSZazOHy68A=
maunium.net/go/mautrix v0.8.3 h1:nKGdARVCf2w7thEN5GEbAjYrlLjKLX44jOdB1h+BV7U=
maunium.net/go/mautrix v0.8.3/go.mod h1:LPbb/DeAmtOPKnGbJazL9g11cO3mMAaEbLE8udd98BU=
maunium.net/go/mautrix v0.8.4 h1:+X1DLAc+uSq3B9Si/3mG43GtXnw4iPoPN83P1u/tbco=
maunium.net/go/mautrix v0.8.4/go.mod h1:W3yDq9H5qSqo14Gu6rWF9uE5NXLIcmqF7oY0pv5lZs8=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=

View file

@ -459,7 +459,7 @@ func (user *User) PostLogin() {
user.syncPortalsDone = make(chan struct{}, 1)
user.syncWait.Add(1)
user.syncStart <- struct{}{}
go user.intPostLogin(user.Conn)
go user.intPostLogin()
}
func (user *User) tryAutomaticDoublePuppeting() {
@ -530,7 +530,7 @@ func (user *User) postConnPing() bool {
return false
}
func (user *User) intPostLogin(conn *whatsapp.Conn) {
func (user *User) intPostLogin() {
defer user.syncWait.Done()
user.lastReconnection = time.Now().Unix()
user.createCommunity()