Mark profile for refresh when receiving a profile key message

This commit is contained in:
AsamK 2022-01-26 21:57:01 +01:00
parent ede0dfeef4
commit 238455ad6c

View file

@ -301,7 +301,13 @@ public class RecipientStore implements RecipientResolver, ContactsStore, Profile
public void storeProfileKey(RecipientId recipientId, final ProfileKey profileKey) {
synchronized (recipients) {
final var recipient = recipients.get(recipientId);
if (profileKey != null && profileKey.equals(recipient.getProfileKey())) {
if (profileKey != null && profileKey.equals(recipient.getProfileKey()) && (
recipient.getProfile() == null || (
recipient.getProfile().getUnidentifiedAccessMode() != Profile.UnidentifiedAccessMode.UNKNOWN
&& recipient.getProfile().getUnidentifiedAccessMode()
!= Profile.UnidentifiedAccessMode.DISABLED
)
)) {
return;
}