From 9a3bb28801ac4898a9ec46e22b80d7b441d1e8ad Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 9 Dec 2021 15:54:01 +0200 Subject: [PATCH] Fix mistake in login code --- commands.go | 2 +- provisioning.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands.go b/commands.go index 8d996cf..ffc91b5 100644 --- a/commands.go +++ b/commands.go @@ -509,7 +509,7 @@ func (handler *CommandHandler) CommandLogin(ce *CommandEvent) { var qrEventID id.EventID for item := range qrChan { - switch item.Code { + switch item.Event { case whatsmeow.QRChannelSuccess.Code: jid := ce.User.Client.Store.ID ce.Reply("Successfully logged in as +%s (device #%d)", jid.User, jid.Device) diff --git a/provisioning.go b/provisioning.go index 24566f3..aaae5db 100644 --- a/provisioning.go +++ b/provisioning.go @@ -307,7 +307,7 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) { for { select { case evt := <-qrChan: - switch evt.Code { + switch evt.Event { case whatsmeow.QRChannelSuccess.Code: jid := user.Client.Store.ID user.log.Debugln("Successful login as", jid, "via provisioning API")