Skip to content

Conversation

redbullpeter
Copy link

This PR adds support for private (1-to-1) chats in the WhatsApp multi-device bridge. Previously, the bridge only supported group chats, but this enhancement allows users to bridge private messages with other platforms.

Changes

Added validation for private chat JIDs (ending with @s.whatsapp.net) in the JoinChannel function
Added a new helper function isPrivateJid() to identify private chat JIDs
Implemented appropriate validation and logging for private chats

Usage
To use this feature, configure a gateway with a private chat JID as the channel:

[[gateway.inout]]
account="whatsapp.bridge"
channel="[email protected]"

The JID format is the WhatsApp phone number followed by @s.whatsapp.net.

Testing
The changes have been tested in an actively used system with multiple group and private chats and both function correctly.

Notes

If the contact isn't in the user's contacts list, a warning is logged but the bridge will still attempt to connect
All message types (text, media, etc.) work with private chats without additional changes since the underlying protocol handles them similarly to group messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant