From a89d0f43fbcf3bfaf37aeaa635a801db964b7d7f Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 15 Nov 2021 13:38:10 +0200 Subject: [PATCH] Update whatsmeow --- commands.go | 3 ++- go.mod | 2 +- go.sum | 4 ++-- provisioning.go | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 184af70..dde8a7b 100644 --- a/commands.go +++ b/commands.go @@ -26,6 +26,7 @@ import ( "strings" "github.com/skip2/go-qrcode" + "go.mau.fi/whatsmeow/appstate" "maunium.net/go/maulogger/v2" @@ -502,7 +503,7 @@ func (handler *CommandHandler) CommandLogin(ce *CommandEvent) { case whatsmeow.QRChannelScannedWithoutMultidevice: ce.Reply("Please enable the WhatsApp multidevice beta and scan the QR code again.") default: - qrEventID = ce.User.sendQR(ce, string(item), qrEventID) + qrEventID = ce.User.sendQR(ce, item.Code, qrEventID) } } _, _ = ce.Bot.RedactEvent(ce.RoomID, qrEventID) diff --git a/go.mod b/go.mod index 2da183a..ef4cc3c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/mattn/go-sqlite3 v1.14.9 github.com/prometheus/client_golang v1.11.0 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e - go.mau.fi/whatsmeow v0.0.0-20211110182414-ba28bae40fb5 + go.mau.fi/whatsmeow v0.0.0-20211113222648-c35fb9adc83e golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b diff --git a/go.sum b/go.sum index ea2698a..301ebed 100644 --- a/go.sum +++ b/go.sum @@ -139,8 +139,8 @@ github.com/tidwall/sjson v1.2.3 h1:5+deguEhHSEjmuICXZ21uSSsXotWMA0orU783+Z7Cp8= github.com/tidwall/sjson v1.2.3/go.mod h1:5WdjKx3AQMvCJ4RG6/2UYT7dLrGvJUV1x4jdTAyGvZs= go.mau.fi/libsignal v0.0.0-20211109153248-a67163214910 h1:9FFhG0OmkuMau5UEaTgiUQ+7cSbtbOQ7hiWKdN8OI3I= go.mau.fi/libsignal v0.0.0-20211109153248-a67163214910/go.mod h1:AufGrvVh+00Nc07Jm4hTquh7yleZyn20tKJI2wCPAKg= -go.mau.fi/whatsmeow v0.0.0-20211110182414-ba28bae40fb5 h1:ERlXDWd0vj62SldgFSqCkjtVpyUgmxRtyKMH20ADW7Q= -go.mau.fi/whatsmeow v0.0.0-20211110182414-ba28bae40fb5/go.mod h1:8jUjOAi3xtGubxcZgG8uSHpAdyQXBRbWAfxkctX/4y4= +go.mau.fi/whatsmeow v0.0.0-20211113222648-c35fb9adc83e h1:B68D3jkafkxuGfhPkkThGe1fEYdCnTGxXFlMq3x6D60= +go.mau.fi/whatsmeow v0.0.0-20211113222648-c35fb9adc83e/go.mod h1:8jUjOAi3xtGubxcZgG8uSHpAdyQXBRbWAfxkctX/4y4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/provisioning.go b/provisioning.go index d913df9..1dfb5d3 100644 --- a/provisioning.go +++ b/provisioning.go @@ -336,7 +336,8 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) { continue default: _ = c.WriteJSON(map[string]interface{}{ - "code": string(evt), + "code": evt.Code, + "timeout": int(evt.Timeout.Seconds()), }) continue }