whatsapp icon indicating copy to clipboard operation
whatsapp copied to clipboard

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

Open AndrewFerr opened this issue 3 years ago • 1 comments

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.

AndrewFerr avatar Jun 23 '22 12:06 AndrewFerr

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.

AndrewFerr avatar Jun 27 '22 14:06 AndrewFerr