Update go-whatsapp

This commit is contained in:
Tulir Asokan 2021-03-19 20:52:15 +02:00
parent d07cba4c87
commit 024d9a0b0e
4 changed files with 3 additions and 4 deletions

View file

@ -133,7 +133,6 @@ func (prov *ProvisioningAPI) AsmuxPing(w http.ResponseWriter, r *http.Request) {
go user.HandleError(err) go user.HandleError(err)
resp.Error = AsmuxWAPingFalse resp.Error = AsmuxWAPingFalse
} else if errors.Is(err, whatsapp.ErrConnectionTimeout) { } else if errors.Is(err, whatsapp.ErrConnectionTimeout) {
user.Conn.CountTimeout()
resp.Error = AsmuxWATimeout resp.Error = AsmuxWATimeout
} else if err != nil { } else if err != nil {
resp.Error = AsmuxWAPingError resp.Error = AsmuxWAPingError

2
go.mod
View file

@ -16,4 +16,4 @@ require (
maunium.net/go/mautrix v0.9.2 maunium.net/go/mautrix v0.9.2
) )
replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.4.0 replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.4.1

2
go.sum
View file

@ -317,6 +317,8 @@ github.com/tulir/go-whatsapp v0.4.0-rc.4 h1:S0ZLzeZPYUj6fATACy7Kzok9TcnntLa1xDJK
github.com/tulir/go-whatsapp v0.4.0-rc.4/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E= github.com/tulir/go-whatsapp v0.4.0-rc.4/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E=
github.com/tulir/go-whatsapp v0.4.0 h1:rvWQZkJrDSoO8IaltASUjYTXjPymByv45RPTL0ApcYQ= github.com/tulir/go-whatsapp v0.4.0 h1:rvWQZkJrDSoO8IaltASUjYTXjPymByv45RPTL0ApcYQ=
github.com/tulir/go-whatsapp v0.4.0/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E= github.com/tulir/go-whatsapp v0.4.0/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E=
github.com/tulir/go-whatsapp v0.4.1 h1:NGgFhJOXRx8TGcF5eDJaE5QBBrriGdZf9X2jbKtqAYI=
github.com/tulir/go-whatsapp v0.4.1/go.mod h1:rwwuTh1bKqhgrRvOBAr8hDqtuz8Cc1Quqw/0BeXb+/E=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= 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/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=

View file

@ -273,8 +273,6 @@ func (prov *ProvisioningAPI) Ping(w http.ResponseWriter, r *http.Request) {
if err == whatsapp.ErrPingFalse { if err == whatsapp.ErrPingFalse {
user.log.Debugln("Forwarding ping false error from provisioning API to HandleError") user.log.Debugln("Forwarding ping false error from provisioning API to HandleError")
go user.HandleError(err) go user.HandleError(err)
} else if errors.Is(err, whatsapp.ErrConnectionTimeout) {
user.Conn.CountTimeout()
} }
if err != nil { if err != nil {
errStr = err.Error() errStr = err.Error()