public void addRecipient ( OmemoDevice contactsDevice ) throws NoIdentityKeyException , CorruptedOmemoKeyException , UndecidedOmemoIdentityException , UntrustedOmemoIdentityException { OmemoFingerprint fingerprint ; fingerprint = OmemoService . getInstance ( ) . getOmemoStoreBackend ( ) . getFingerprint ( userDevice , contactsDevice ) ; switch ( trustCallback . getTrust ( contactsDevice , fingerprint ) ) { case undecided : throw new UndecidedOmemoIdentityException ( contactsDevice ) ; case trusted : CiphertextTuple encryptedKey = ratchet . doubleRatchetEncrypt ( contactsDevice , messageKey ) ; keys . add ( new OmemoKeyElement ( encryptedKey . getCiphertext ( ) , contactsDevice . getDeviceId ( ) , encryptedKey . isPreKeyMessage ( ) ) ) ; break ; case untrusted : throw new UntrustedOmemoIdentityException ( contactsDevice , fingerprint ) ; } }
Add a new recipient device to the message .