]> git.giacomolli.uk - onechat/commit
Show the WhatsApp link with /whatsapp status
authorAnderson A. Giacomolli <redacted>
Sun, 8 Nov 2026 14:36:14 +0000 (11:36 -0300)
committerAnderson A. Giacomolli <redacted>
Sun, 8 Nov 2026 14:36:14 +0000 (11:36 -0300)
commitec230eee6b06580031637bc97c99ec6db7b41926
treefa34422adb9929f4fc4f316d60f4ade1d1f8eee0
parentcb514b662bcf9d90b2cf02789c989f777d774d3f
Show the WhatsApp link with /whatsapp status

The daemon opens the WhatsApp session in whatsapp/session.db and keeps a
linked device connected, so the next steps can pair, read, and send. The
line /whatsapp status in the terminal client or in Telegram tells
whether WhatsApp is not linked, linked and connected, or linked and
disconnected, with the times of the connection.

The clients handle a /whatsapp line before it reaches the agent, and the
daemon answers only the client that asked, with a notice event that the
terminal client now shows. So the lines of the later pairing, which hold
the phone number and the code, never reach the log, the model, or the
other client.

The session gives full access to the account, so the daemon refuses a
session file whose mode is not 0600, and the library logs nothing,
because its log lines hold the own phone number. The daemon opens the
session only after it holds the lock of the data directory. The library
and its SQLite driver, modernc.org/sqlite, are pure Go.

Issue: 6f69ca1
12 files changed:
README.rst
daemon.go
daemon_start_helper_test.go
go.mod
go.sum
nix/package.nix
socket.go
telegram.go
terminal.go
whatsapp.go [new file with mode: 0644]
whatsapp_fake_helper_test.go [new file with mode: 0644]
whatsapp_test.go [new file with mode: 0644]