Search code examples
ejabberdsmack

How does WhatsApp syn up contacts with ejabberd


I am creating ejabberd xmpp client for charting similar to WhatsApp. Want to understand, how does WhatsApp sync contacts with server? How does WhatsApp find out all registered users with server and synchronise it with your address book?


Solution

  • This feature is not related to XMPP or ejabberd. If you want to detect contact of your user you need to implement that feature in a custom way.

    You need to upload an anonymised version of the user address book with hash of phone number and email and store that on your server. When another user with a phone number or email address matching that hashes join the service you can find who knows it and do operations to notify each parties that they are both using the service (and/or add them in roster for example).

    So, this is a purely custom extension to ejabberd you will have to implement.