Fix mistake in login code

This commit is contained in:
Tulir Asokan 2021-12-09 15:54:01 +02:00
parent 9dc1b7911f
commit 9a3bb28801
2 changed files with 2 additions and 2 deletions

View file

@ -509,7 +509,7 @@ func (handler *CommandHandler) CommandLogin(ce *CommandEvent) {
var qrEventID id.EventID var qrEventID id.EventID
for item := range qrChan { for item := range qrChan {
switch item.Code { switch item.Event {
case whatsmeow.QRChannelSuccess.Code: case whatsmeow.QRChannelSuccess.Code:
jid := ce.User.Client.Store.ID jid := ce.User.Client.Store.ID
ce.Reply("Successfully logged in as +%s (device #%d)", jid.User, jid.Device) ce.Reply("Successfully logged in as +%s (device #%d)", jid.User, jid.Device)

View file

@ -307,7 +307,7 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) {
for { for {
select { select {
case evt := <-qrChan: case evt := <-qrChan:
switch evt.Code { switch evt.Event {
case whatsmeow.QRChannelSuccess.Code: case whatsmeow.QRChannelSuccess.Code:
jid := user.Client.Store.ID jid := user.Client.Store.ID
user.log.Debugln("Successful login as", jid, "via provisioning API") user.log.Debugln("Successful login as", jid, "via provisioning API")