- private Profile decryptProfileIfKeyKnown(
- final RecipientId recipientId, final SignalServiceProfile encryptedProfile
- ) {
- var profileKey = account.getProfileStore().getProfileKey(recipientId);
- if (profileKey == null) {
- return new Profile(System.currentTimeMillis(),
- null,
- null,
- null,
- null,
- null,
- ProfileUtils.getUnidentifiedAccessMode(encryptedProfile, null),
- ProfileUtils.getCapabilities(encryptedProfile));
+ if (newProfile == null) {
+ newProfile = (
+ profile == null ? Profile.newBuilder() : Profile.newBuilder(profile)
+ ).withLastUpdateTimestamp(now)
+ .withUnidentifiedAccessMode(Profile.UnidentifiedAccessMode.UNKNOWN)
+ .withCapabilities(Set.of())
+ .build();