Skip to content

feat(whatsapp): rewrite service using tulir/whatsmeow#1021

Open
Jakeyzerk wants to merge 15 commits into
nikoksr:mainfrom
Jakeyzerk:feat/whatsapp-whatsmeow
Open

feat(whatsapp): rewrite service using tulir/whatsmeow#1021
Jakeyzerk wants to merge 15 commits into
nikoksr:mainfrom
Jakeyzerk:feat/whatsapp-whatsmeow

Conversation

@Jakeyzerk
Copy link
Copy Markdown

@Jakeyzerk Jakeyzerk commented May 10, 2026

Summary

Replaces the abandoned Rhymen/go-whatsapp with tulir/whatsmeow to support WhatsApp's current Multi-Device protocol. This fixes the broken WhatsApp service.

Closes #274

Changes

  • Authentication: Supports both QR code (scannable from Android, iOS, Windows app, or WhatsApp Web) and 8-digit pairing code via LoginWithPairingCode() — useful for headless servers with no display.
  • Dependencies: Uses modernc.org/sqlite for CGO-free builds. Tested on Termux/Android
  • Session: dbPath is an explicit parameter in both login methods. No default file is created
  • Interface: Implements notify.Notifier with Send(), AddReceivers()
  • Helpers: Added Disconnect() and IsConnected() for connection management
  • Docs: Updated service/whatsapp/README.md with new usage examples
  • Multi-Device: Uses whatsmeow's Multi-Device protocol, phone does not need to stay online after pairing. Session persists across restarts via SQLite.

Notes for Maintainer

Per discussion in #274, dbPath is currently explicit. Awaiting decision on whether to add a default path whatsmeow.db or keep it explicit to prevent unintended file creation.

New() returns *Service without error because the constructor cannot fail. Actual initialization happens lazily in LoginWithQRCode or LoginWithPairingCode. Happy to change to (*Service, error) if consistency with other services is preferred.

Testing

Tested manual login + send message on Android/Termux. Session reconnects correctly after process restart without re-authenticating.

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests to cover my changes. Manual test only, no unit tests yet
  • All new and existing tests passed. Manual test passed
  • I have read the Contributing Guidelines

Replaces the abandoned Rhymen/go-whatsapp with tulir/whatsmeow,
which supports WhatsApp's current Multi-Device protocol.

- Supports QR code and pairing code authentication
- Session persisted via SQLite (modernc.org/sqlite, no CGO)
- Implements notify.Notifier interface (Send, AddReceivers)
- Adds Disconnect() and IsConnected() helpers
- Thread-safe connection state tracking

Closes nikoksr#274
@Jakeyzerk Jakeyzerk closed this May 14, 2026
@Jakeyzerk Jakeyzerk reopened this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Whatsapp service not usable anymore

1 participant