err := client.ConnectContext(ctx)
if err != nil {
- w.logger.Printf("WhatsApp messages do not come, because the connection failed, and it is tried again only at a restart of the daemon: %s", w.redact(err.Error()))
+ w.logger.Printf("connect failed, restart to retry: %s", w.redact(err.Error()))
}
}
return nil
}
- w.logger.Print("WhatsApp messages stop, because the phone logged out this device (run /whatsapp pair PHONE to link it again)")
+ w.logger.Print("logged out by the phone, run /whatsapp pair PHONE")
err := w.inbox.deliver(ctx, l, w.link(), true)
if err != nil {
return err
err = w.removeSession()
if err != nil {
- w.logger.Printf("the session of the logged out device stays on the disk, because its delete failed: %v", err)
+ w.logger.Printf("session delete failed: %v", err)
}
err = l.note("WhatsApp was unlinked from the phone.")
if err != nil {
- w.logger.Printf("the chat has no note of the logout, because its write failed: %v", err)
+ w.logger.Printf("chat note failed: %v", err)
}
w.broadcast("WhatsApp was unlinked from the phone. Run /whatsapp pair PHONE to link it again.")
return nil
}
- w.logger.Print("WhatsApp messages stop, because the user unlinked WhatsApp")
+ w.logger.Print("unlinked")
err = l.note("WhatsApp is unlinked.")
if err != nil {
- w.logger.Printf("the chat has no note of the unlink, because its write failed: %v", err)
+ w.logger.Printf("chat note failed: %v", err)
}
if client == nil || logoutErr != nil {
case item.Event == whatsmeow.QRChannelSuccess.Event:
linked = true
w.linkedBy(client)
- w.logger.Print("WhatsApp is linked")
+ w.logger.Print("linked")
err = l.note("WhatsApp is linked.")
if err != nil {
- w.logger.Printf("the chat has no note of the link, because its write failed: %v", err)
+ w.logger.Printf("chat note failed: %v", err)
}
answer("WhatsApp is linked to +" + phone + ".")
switch {
case !w.linked || w.connected:
case w.disconnectedAt.IsZero():
- line = "WhatsApp is connected, and new messages come in"
+ line = "connected"
default:
- line = "WhatsApp is connected again, after " + durationText(w.clock().Sub(w.disconnectedAt))
+ line = "connected again after " + durationText(w.clock().Sub(w.disconnectedAt))
}
w.connected = true
}
case *events.Disconnected:
if w.linked && (w.connected || w.disconnectedAt.IsZero()) {
- line = "new WhatsApp messages wait, because the connection is lost (the next try is automatic)"
+ line = "disconnected, retrying"
if !w.connected {
- line = "new WhatsApp messages wait, because the first connection failed (the next try is automatic)"
+ line = "first connect failed, retrying"
}
w.disconnectedAt = w.clock()
w.connected = false
w.noticed = true
notice = "WhatsApp is disconnected and does not connect again by itself: " + event.PermanentDisconnectDescription() + ". Restart the daemon to try again."
- line = "WhatsApp messages do not come, because the connection is lost and it is tried again only at a restart of the daemon: " + whatsappRedact(w.own, event.PermanentDisconnectDescription())
+ line = "disconnected for good, restart to retry: " + whatsappRedact(w.own, event.PermanentDisconnectDescription())
}
}