From 23308d7e8c4b7f5c85bffe870ba92010a3784dcb Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Tue, 12 Oct 2021 12:18:15 +0100 Subject: [PATCH] Allow profile pictures from contacts --- VERSION | 2 +- protocol/messenger_handler.go | 5 ++++- protocol/messenger_identity_image_test.go | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index cfa60a845..706f965e9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.89.10 +0.89.11 diff --git a/protocol/messenger_handler.go b/protocol/messenger_handler.go index 0e25b1aa6..9b31fe338 100644 --- a/protocol/messenger_handler.go +++ b/protocol/messenger_handler.go @@ -1359,7 +1359,10 @@ func (m *Messenger) HandleChatIdentity(state *ReceivedMessageState, ci protobuf. // If we don't want to view profile images from anyone, don't process identity images. // We don't want to store the profile images of other users, even if we don't display images. - if viewFromNoOne { + inOurContacts, ok := m.allContacts.Load(state.CurrentMessageState.Contact.ID) + + isContact := ok && inOurContacts.Added + if viewFromNoOne && !isContact { return nil } diff --git a/protocol/messenger_identity_image_test.go b/protocol/messenger_identity_image_test.go index 908d77656..7b93b8af0 100644 --- a/protocol/messenger_identity_image_test.go +++ b/protocol/messenger_identity_image_test.go @@ -512,7 +512,8 @@ func resultExpectedVS(vs accounts.ProfilePicturesVisibilityType, bc bool) (bool, case accounts.ProfilePicturesVisibilityEveryone: return true, nil case accounts.ProfilePicturesVisibilityNone: - return false, nil + // If we are contacts, we save the image regardless + return bc, nil default: return false, errors.New("unknown ProfilePicturesVisibilityType") }