From: Anderson A. Giacomolli Date: Sun, 8 Nov 2026 14:44:00 +0000 (-0300) Subject: Link WhatsApp with a pairing code X-Git-Url: https://git.giacomolli.uk/onechat/commitdiff_plain/0018014ab36f3de61a4b8a5515009dab803d6c38?ds=inline;hp=0018014ab36f3de61a4b8a5515009dab803d6c38 Link WhatsApp with a pairing code The line /whatsapp pair PHONE in the terminal client or in Telegram links the WhatsApp account of PHONE as a linked device. The daemon answers with the steps and then with the pairing code in its own message, so that it is easy to copy, and later with the linked number, an expired code, or the failure. A new pairing ends the one before. /whatsapp unlink logs the device out and deletes the session, and tells the user to remove the device in the phone when the logout cannot reach WhatsApp. The phone number and the code go only to the client that asked. The log of the agent gets only the notes that WhatsApp is linked or unlinked, and the errors in the daemon log show the own number and the own LID as OWN. When the user removes the device in the phone, the daemon deletes the session, notes it, and tells all clients one time. A disconnection that lasts 10 minutes gives all clients one notice, not one for each retry of the library, and one more when the connection comes back. A disconnection that the library does not retry gives a notice at once. The pair and unlink commands run one at a time in the WhatsApp goroutine of the daemon, which ends a running pairing at the stop of the daemon. Issue: 6f69ca1 ---