Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow DMs to the MXID of a WhatsApp puppet that doesn't yet exist #523

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AndrewFerr
Copy link

Fixes #284

This allows starting a new WhatsApp DM by inviting a Matrix user with an ID of @whatsapp_<phoneNumber>:domain (or whatever the puppet user template was configured as), as an alternative to using the pm command.

This feature was already mostly implemented; this PR just fills the holes that were preventing it from working.

If the HS queries the bridge for a WA puppet user that doesn't exist,
try to register a Matrix account for it so that later bridge operations
may use that puppet.
@AndrewFerr
Copy link
Author

Note that this doesn't check if the puppet's phone number is valid, because it can't: appservice user queries don't include which Matrix user (if any) triggered the query, so the bridge can't immediately know which bridge user's WhatsApp client to use to perform checks.

Thus, the phone number check in fnPM (i.e. the call to Client.IsOnWhatsApp) should be copied/moved into either WABridge.createPrivatePortalFromInvite or Puppet.SyncContact, by which point the bridge user is known.

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

Successfully merging this pull request may close these issues.

Inviting a non-contact matrix puppet of whatsApp user to a new room don't work as expected
1 participant