Only set UNRESTRICTED mode if recipients have a non-null verifier.

Otherwise we could send UD messages to people with non-UD linked
devices.
This commit is contained in:
Greyson Parrelli 2018-11-06 09:58:45 -08:00
parent 1ab3d57378
commit bf9582c97e

View File

@ -171,7 +171,7 @@ public class RetrieveProfileJob extends ContextJob implements InjectableType {
RecipientDatabase recipientDatabase = DatabaseFactory.getRecipientDatabase(context);
byte[] profileKey = recipient.getProfileKey();
if (unrestrictedUnidentifiedAccess) {
if (unrestrictedUnidentifiedAccess && unidentifiedAccessVerifier != null) {
Log.i(TAG, "Marking recipient UD status as unrestricted.");
recipientDatabase.setUnidentifiedAccessMode(recipient, UnidentifiedAccessMode.UNRESTRICTED);
} else if (profileKey == null || unidentifiedAccessVerifier == null) {