feat: only show profile pics for contacts by default

But add a profile switch to show them for everyone
This commit is contained in:
Jonathan Rainville 2021-01-15 10:37:23 -05:00 committed by Iuri Matias
parent 51083e2005
commit 7230cdf7c7
3 changed files with 31 additions and 0 deletions

View File

@ -90,6 +90,28 @@ Item {
//% "Privacy"
text: qsTrId("privacy")
}
RowLayout {
spacing: Style.current.padding
width: parent.width
StyledText {
text: qsTr("Display all profile pictures (not only contacts)")
font.pixelSize: 15
font.weight: Font.Medium
Layout.fillWidth: true
}
StatusSwitch {
id: showOnlyContactsPicsSwitch
Layout.rightMargin: 0
checked: !appSettings.onlyShowContactsProfilePics
onCheckedChanged: function (value) {
appSettings.onlyShowContactsProfilePics = !this.checked
}
}
}
RowLayout {
spacing: Style.current.padding
width: parent.width

View File

@ -25,6 +25,13 @@ RowLayout {
return
}
if (appSettings.onlyShowContactsProfilePics) {
const isContact = profileModel.contacts.list.rowData(index, "isContact")
if (isContact === "false") {
return
}
}
return profileModel.contacts.list.rowData(index, useLargeImage ? "largeImage" : "thumbnailImage")
}

View File

@ -112,6 +112,7 @@ ApplicationWindow {
property bool neverAskAboutUnfurlingAgain: false
property bool hideChannelSuggestions: false
property bool hideSignPhraseModal: false
property bool onlyShowContactsProfilePics: true
property int fontSize: Constants.fontSizeM
@ -160,6 +161,7 @@ ApplicationWindow {
property bool hideChannelSuggestions: defaultAppSettings.hideChannelSuggestions
property int fontSize: defaultAppSettings.fontSize
property bool hideSignPhraseModal: defaultAppSettings.hideSignPhraseModal
property bool onlyShowContactsProfilePics: defaultAppSettings.onlyShowContactsProfilePics
// Browser settings
property bool showBrowserSelector: defaultAppSettings.showBrowserSelector