Support contact discovery
nanu-c opened this issue · 2 comments
nanu-c commented
This currently not possible and it looks like, it takes a lot of effort. I did some experiments but there is a lot todo.
rubdos commented
There's also two sides to this, correct? Registration with PNI instead of plain phone number (which will, I assume, soon be mandatory), keeping that registration current, and then the lookup part.
Do you have some documentation on what needs to happen?
nanu-c commented
I am not sure, with "we need the pni". Actually it works now similar to the group directory.
- Ask "/v2/directory/auth" for a cdsi credential
- Optional: use the token from the previous contact discovery request
- do parseAndSortE164Strings
- use the cdsi credential to make an request
- parse the result and update the contacts storage
The logic is still implemented in Java for signal android
https://github.com/signalapp/Signal-Android/blob/63cca2de6668c11e20c4c506fd61513d42c49711/app/src/main/java/org/thoughtcrime/securesms/contacts/sync/ContactDiscoveryRefreshV2.kt#L131