fix(@chat/members): display member's picture according to settings

Closes: #7309

Two fixes:
- current user's picture is always visible
- hide pictures off all members (excluding self) when "noOne" options is
set
This commit is contained in:
Michał Cieślak 2022-09-16 14:03:26 +02:00 committed by Michał
parent 8c4ce7bc29
commit 992bd01f83
1 changed files with 9 additions and 7 deletions

View File

@ -81,13 +81,15 @@ Item {
isUntrustworthy: model.isUntrustworthy
isAdmin: model.isAdmin
asset.name: {
if ((!model.isContact &&
Global.privacyModuleInst.profilePicturesVisibility !==
Constants.profilePicturesVisibility.everyone)) {
return "";
}
//TODO check if icon is rendered correctly
return model.icon;
const isCurrentUser = model.pubKey === root.rootStore.getPubkey()
const visibility = Global.privacyModuleInst.profilePicturesVisibility
if (isCurrentUser
|| visibility === Constants.profilePicturesVisibility.everyone
|| (visibility === Constants.profilePicturesVisibility.contactsOnly && model.isContact))
return model.icon
return ""
}
asset.isImage: (asset.name !== "")
asset.isLetterIdenticon: (asset.name === "")