Skip to content

Implement PNI

Ruben De Smet requested to merge pni into main

Toward #459

Depends on https://github.com/whisperfish/libsignal-service-rs/pull/285

  • Ensure pre key refresh runs only after PNI identity key provisioning/pni distribution happened.
  • Receiving on the PNI endpoint should flag the recipient for PNI signatures
  • When sending a message to a recipient, we should add a PNI signature when the flag is set on the recipient
  • Handle the PNP initialization as linked device when receiving the initialization message.
  • If we receive on a PNI prekey and signed prekey, should we send via the same store? The session exists in that store, so I would assume we should.
  • ! Add, expose, connect setting for enabling/disabling PNI discovery
  • Add setting for sharing phone number with contact(s) over ACI
  • Keep track of sent messages with PNI signatures
  • Mark PNI endpoint as not requiring signature when a PNI sig has been successfully received, based on keeping track of those messages

Things I won't do here, but are still necessary when we want to send to PNI:

  • Add a PNI column along the ACI/UUID column
  • Add the PNI reconciliation logic

Things that we could tackle here:

  • Get rid of the signaling key; we don't use it anymore
  • Readd the identity key cache
  • id INTEGER PRIMARY KEY ON CONFLICT REPLACE NOT NULL -> We might want to get rid of the ON CONFLICT clause. Double check with SA
  • Sync the PNP setting with the linked devices. That's apparently a thing on the profile
  • Check whether we locally have at least 1xPQ-last-resort and 1xEC-signed prekeys for both ACI and PNI, otherwise force the prekey refresh.
Edited by Ruben De Smet

Merge request reports