UserImage refactored to remove dependency on backend via Utils
This commit is contained in:
parent
f02f957bf5
commit
b8f9566116
|
@ -206,6 +206,8 @@ Rectangle {
|
|||
|
||||
name: model.name
|
||||
pubkey: model.publicKey
|
||||
colorHash: model.colorHash
|
||||
colorId: model.colorId
|
||||
image: model.icon
|
||||
interactive: false
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ Item {
|
|||
property string alias: model.alias
|
||||
property string ensName: model.ensName
|
||||
property string icon: model.icon
|
||||
property var colorHash: model.colorHash
|
||||
property int colorId: model.colorId
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +75,9 @@ Item {
|
|||
name: listItem.name || listItem.alias,
|
||||
nickname: listItem.nickname,
|
||||
ensName: listItem.ensName,
|
||||
icon: listItem.icon
|
||||
icon: listItem.icon,
|
||||
colorHash: listItem.colorHash,
|
||||
colorId: listItem.colorId
|
||||
}
|
||||
if (all || isAcceptedItem(filter, item)) {
|
||||
filterModel.append(item)
|
||||
|
|
|
@ -129,6 +129,8 @@ Item {
|
|||
profileType, trustStatus, contactType, ensVerified, onlineStatus, hasLocalNickname, chatType, isAdmin,
|
||||
publicKey: model.pubKey,
|
||||
emojiHash: model.emojiHash,
|
||||
colorHash: model.colorHash,
|
||||
colorId: model.colorId,
|
||||
displayName: nickName || userName,
|
||||
userIcon: model.icon
|
||||
})
|
||||
|
@ -175,35 +177,36 @@ Item {
|
|||
root.store.chatCommunitySectionModule.createOneToOneChat("", profileContextMenu.publicKey, "")
|
||||
}
|
||||
onReviewContactRequest: {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.openReviewContactRequestPopup(profileContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onSendContactRequest: {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.openContactRequestPopup(profileContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onEditNickname: {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
|
||||
Global.openNicknamePopupRequested(profileContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onRemoveNickname: (displayName) => {
|
||||
root.store.contactsStore.changeContactNickname(profileContextMenu.publicKey, "", displayName, true)
|
||||
}
|
||||
onUnblockContact: {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.unblockContactRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onMarkAsUntrusted: {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.markAsUntrustedRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onRemoveTrustStatus: root.store.contactsStore.removeTrustStatus(profileContextMenu.publicKey)
|
||||
onRemoveContact: {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.removeContactRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onBlockContact: {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.blockContactRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onRemoveFromGroup: {
|
||||
|
|
|
@ -319,6 +319,7 @@ Item {
|
|||
Global.openMenu(memberContextMenuComponent, this, {
|
||||
profileType, trustStatus, contactType, ensVerified, onlineStatus, hasLocalNickname,
|
||||
publicKey: model.pubKey, emojiHash: root.utilsStore.getEmojiHash(model.pubKey),
|
||||
colorHash: model.colorHash, colorId: model.colorId,
|
||||
displayName: memberItem.title || model.displayName,
|
||||
userIcon: icon.name,
|
||||
})
|
||||
|
@ -342,35 +343,35 @@ Item {
|
|||
root.rootStore.chatCommunitySectionModule.createOneToOneChat("", membersContextMenuView.publicKey, "")
|
||||
}
|
||||
onReviewContactRequest: {
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true, true)
|
||||
Global.openReviewContactRequestPopup(memberContextMenuView.publicKey, contactDetails, null)
|
||||
}
|
||||
onSendContactRequest: {
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true, true)
|
||||
Global.openContactRequestPopup(memberContextMenuView.publicKey, contactDetails, null)
|
||||
}
|
||||
onEditNickname: {
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true, true)
|
||||
Global.openNicknamePopupRequested(memberContextMenuView.publicKey, contactDetails, null)
|
||||
}
|
||||
onRemoveNickname: (displayName) => {
|
||||
root.rootStore.contactsStore.changeContactNickname(memberContextMenuView.publicKey, "", displayName, true)
|
||||
}
|
||||
onUnblockContact: {
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true, true)
|
||||
Global.unblockContactRequested(memberContextMenuView.publicKey, contactDetails)
|
||||
}
|
||||
onMarkAsUntrusted: {
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true, true)
|
||||
Global.markAsUntrustedRequested(memberContextMenuView.publicKey, contactDetails)
|
||||
}
|
||||
onRemoveTrustStatus: root.rootStore.contactsStore.removeTrustStatus(memberContextMenuView.publicKey)
|
||||
onRemoveContact: {
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true, true)
|
||||
Global.removeContactRequested(memberContextMenuView.publicKey, contactDetails)
|
||||
}
|
||||
onBlockContact: {
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
|
||||
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true, true)
|
||||
Global.blockContactRequested(memberContextMenuView.publicKey, contactDetails)
|
||||
}
|
||||
onClosed: destroy()
|
||||
|
|
|
@ -26,7 +26,7 @@ Item {
|
|||
property string searchString: ""
|
||||
readonly property int count: contactsList.count
|
||||
|
||||
signal openContactContextMenu(string publicKey, string name, string icon)
|
||||
signal openContactContextMenu(string publicKey)
|
||||
signal sendMessageActionTriggered(string publicKey)
|
||||
signal showVerificationRequest(string publicKey)
|
||||
signal contactRequestAccepted(string publicKey)
|
||||
|
@ -141,8 +141,7 @@ Item {
|
|||
}
|
||||
|
||||
|
||||
onContextMenuRequested: root.openContactContextMenu(
|
||||
model.pubKey, model.preferredDisplayName, model.icon)
|
||||
onContextMenuRequested: root.openContactContextMenu(model.pubKey)
|
||||
onSendMessageRequested: root.sendMessageActionTriggered(model.pubKey)
|
||||
onAcceptContactRequested: root.contactRequestAccepted(model.pubKey)
|
||||
onRejectRequestRequested: root.contactRequestRejected(model.pubKey)
|
||||
|
|
|
@ -215,6 +215,8 @@ StatusDialog {
|
|||
userDisplayName: root.profileStore.displayName
|
||||
userPublicKey: root.profileStore.pubkey
|
||||
userImage: root.profileStore.icon
|
||||
userColorHash: root.profileStore.colorHash
|
||||
userColorId: root.profileStore.colorId
|
||||
|
||||
localPairingState: root.devicesStore.localPairingState
|
||||
localPairingError: root.devicesStore.localPairingError
|
||||
|
|
|
@ -24,7 +24,8 @@ QtObject {
|
|||
readonly property var thumbnailImage: userProfile.thumbnailImage
|
||||
readonly property var largeImage: userProfile.largeImage
|
||||
readonly property int colorId: Utils.colorIdForPubkey(root.pubkey)
|
||||
readonly property var colorHash: Utils.getColorHashAsJson(root.pubkey, name != "")
|
||||
|
||||
readonly property var colorHash: Utils.getColorHashAsJson(root.pubkey)
|
||||
readonly property string defaultDisplayName: ProfileUtils.displayName("", name, displayName, username)
|
||||
|
||||
readonly property string bio: profileModule.bio
|
||||
|
|
|
@ -2,10 +2,11 @@ import QtQuick 2.15
|
|||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core.Utils 0.1
|
||||
|
||||
import utils 1.0
|
||||
|
||||
|
@ -37,7 +38,7 @@ SettingsContentBase {
|
|||
}
|
||||
}
|
||||
|
||||
function openContextMenu(publicKey, name, icon) {
|
||||
function openContextMenu(publicKey, name, icon, colorHash, colorId) {
|
||||
const { profileType, trustStatus, contactType, ensVerified, onlineStatus, hasLocalNickname } = root.contactsStore.getProfileContext(publicKey)
|
||||
|
||||
Global.openMenu(contactContextMenuComponent, this, {
|
||||
|
@ -46,9 +47,16 @@ SettingsContentBase {
|
|||
emojiHash: root.utilsStore.getEmojiHash(publicKey),
|
||||
displayName: name,
|
||||
userIcon: icon,
|
||||
colorHash, colorId
|
||||
})
|
||||
}
|
||||
|
||||
function fetchDataAndOpenContextMenu(model, publicKey) {
|
||||
const entry = ModelUtils.getByKey(model, "pubKey", publicKey)
|
||||
openContextMenu(publicKey, entry.preferredDisplayName,
|
||||
entry.icon, entry.colorHash, entry.colorId)
|
||||
}
|
||||
|
||||
Item {
|
||||
id: contentItem
|
||||
width: root.contentWidth
|
||||
|
@ -63,35 +71,35 @@ SettingsContentBase {
|
|||
onOpenProfileClicked: Global.openProfilePopup(contactContextMenu.publicKey, null, null)
|
||||
onCreateOneToOneChat: root.contactsStore.joinPrivateChat(contactContextMenu.publicKey)
|
||||
onReviewContactRequest: () => {
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true, true)
|
||||
Global.openReviewContactRequestPopup(contactContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onSendContactRequest: () => {
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true, true)
|
||||
Global.openContactRequestPopup(contactContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onEditNickname: () => {
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true, true)
|
||||
Global.openNicknamePopupRequested(contactContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onRemoveNickname: (displayName) => {
|
||||
root.contactsStore.changeContactNickname(contactContextMenu.publicKey, "", displayName, true)
|
||||
}
|
||||
onUnblockContact: () => {
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true, true)
|
||||
Global.unblockContactRequested(contactContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onMarkAsUntrusted: () => {
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true, true)
|
||||
Global.markAsUntrustedRequested(contactContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onRemoveTrustStatus: root.contactsStore.removeTrustStatus(contactContextMenu.publicKey)
|
||||
onRemoveContact: () => {
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true, true)
|
||||
Global.removeContactRequested(contactContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onBlockContact: () => {
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
|
||||
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true, true)
|
||||
Global.blockContactRequested(contactContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onClosed: destroy()
|
||||
|
@ -161,9 +169,7 @@ SettingsContentBase {
|
|||
visible: !noFriendsItem.visible && count > 0
|
||||
contactsModel: root.contactsStore.myContactsModel
|
||||
searchString: searchBox.text
|
||||
onOpenContactContextMenu: function (publicKey, name, icon) {
|
||||
root.openContextMenu(publicKey, name, icon)
|
||||
}
|
||||
onOpenContactContextMenu: root.fetchDataAndOpenContextMenu(contactsModel, publicKey)
|
||||
panelUsage: Constants.contactsPanelUsage.verifiedMutualContacts
|
||||
onSendMessageActionTriggered: {
|
||||
root.contactsStore.joinPrivateChat(publicKey)
|
||||
|
@ -177,9 +183,7 @@ SettingsContentBase {
|
|||
title: qsTr("Contacts")
|
||||
contactsModel: root.contactsStore.myContactsModel
|
||||
searchString: searchBox.text
|
||||
onOpenContactContextMenu: function (publicKey, name, icon) {
|
||||
root.openContextMenu(publicKey, name, icon)
|
||||
}
|
||||
onOpenContactContextMenu: root.fetchDataAndOpenContextMenu(contactsModel, publicKey)
|
||||
panelUsage: Constants.contactsPanelUsage.mutualContacts
|
||||
|
||||
onSendMessageActionTriggered: {
|
||||
|
@ -218,9 +222,7 @@ SettingsContentBase {
|
|||
title: qsTr("Received")
|
||||
searchString: searchBox.text
|
||||
visible: count > 0
|
||||
onOpenContactContextMenu: function (publicKey, name, icon) {
|
||||
root.openContextMenu(publicKey, name, icon)
|
||||
}
|
||||
onOpenContactContextMenu: root.fetchDataAndOpenContextMenu(contactsModel, publicKey)
|
||||
contactsModel: root.contactsStore.receivedContactRequestsModel
|
||||
panelUsage: Constants.contactsPanelUsage.receivedContactRequest
|
||||
|
||||
|
@ -244,9 +246,7 @@ SettingsContentBase {
|
|||
title: qsTr("Sent")
|
||||
searchString: searchBox.text
|
||||
visible: count > 0
|
||||
onOpenContactContextMenu: function (publicKey, name, icon) {
|
||||
root.openContextMenu(publicKey, name, icon)
|
||||
}
|
||||
onOpenContactContextMenu: root.fetchDataAndOpenContextMenu(contactsModel, publicKey)
|
||||
contactsModel: root.contactsStore.sentContactRequestsModel
|
||||
panelUsage: Constants.contactsPanelUsage.sentContactRequest
|
||||
}
|
||||
|
@ -256,9 +256,7 @@ SettingsContentBase {
|
|||
ContactsListPanel {
|
||||
Layout.fillWidth: true
|
||||
searchString: searchBox.text
|
||||
onOpenContactContextMenu: function (publicKey, name, icon) {
|
||||
root.openContextMenu(publicKey, name, icon)
|
||||
}
|
||||
onOpenContactContextMenu: root.fetchDataAndOpenContextMenu(contactsModel, publicKey)
|
||||
contactsModel: root.contactsStore.blockedContactsModel
|
||||
panelUsage: Constants.contactsPanelUsage.blockedContacts
|
||||
visible: (stackLayout.currentIndex === 2)
|
||||
|
|
|
@ -285,6 +285,8 @@ SettingsContentBase {
|
|||
pubkeyVisible: false
|
||||
emojiHashVisible: false
|
||||
editImageButtonVisible: true
|
||||
colorHash: root.profileStore.colorHash
|
||||
colorId: root.profileStore.colorId
|
||||
}
|
||||
|
||||
ProfileDescriptionPanel {
|
||||
|
|
|
@ -877,6 +877,8 @@ Item {
|
|||
|
||||
pubKey: appMain.profileStore.pubkey
|
||||
emojiHash: appMain.utilsStore.getEmojiHash(pubKey)
|
||||
colorHash: appMain.profileStore.colorHash
|
||||
colorId: appMain.profileStore.colorId
|
||||
name: appMain.profileStore.name
|
||||
icon: appMain.profileStore.icon
|
||||
isEnsVerified: !!appMain.profileStore.preferredName
|
||||
|
|
|
@ -78,6 +78,8 @@ CalloutCard {
|
|||
name: root.userData.name
|
||||
pubkey: root.userData.publicKey
|
||||
image: root.userData.image
|
||||
colorId: Utils.colorIdForPubkey(root.userData.publicKey)
|
||||
colorHash: Utils.getColorHashAsJson(root.userData.publicKey)
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
|
|
|
@ -32,6 +32,8 @@ Item {
|
|||
property bool isCurrentUser
|
||||
property bool userIsEnsVerified
|
||||
property rect cropRect
|
||||
property var colorHash: []
|
||||
property int colorId
|
||||
|
||||
property int imageSize: ProfileHeader.ImageSize.Compact
|
||||
property bool displayNameVisible: true
|
||||
|
@ -115,9 +117,12 @@ Item {
|
|||
|
||||
UserImage {
|
||||
id: userImage
|
||||
|
||||
objectName: "ProfileHeader_userImage"
|
||||
name: root.displayName
|
||||
pubkey: root.pubkey
|
||||
colorHash: root.colorHash
|
||||
colorId: root.colorId
|
||||
image: root.previewIcon
|
||||
interactive: false
|
||||
imageWidth: d.getSize(36, 64, 170)
|
||||
|
|
|
@ -25,8 +25,8 @@ Loader {
|
|||
property bool isBridgedAccount: false
|
||||
property int onlineStatus: Constants.onlineStatus.unknown
|
||||
|
||||
property int colorId: Utils.colorIdForPubkey(pubkey)
|
||||
property var colorHash: Utils.getColorHashAsJson(pubkey, ensVerified)
|
||||
property int colorId
|
||||
property var colorHash: []
|
||||
|
||||
signal clicked()
|
||||
|
||||
|
|
|
@ -5,5 +5,7 @@ QtObject {
|
|||
property string publicKey
|
||||
property string bio
|
||||
property string image
|
||||
property bool ensVerified
|
||||
property bool ensVerified
|
||||
property int colorId
|
||||
property var colorHash
|
||||
}
|
||||
|
|
|
@ -48,6 +48,8 @@ StatusDialog {
|
|||
UserImage {
|
||||
name: root.mainDisplayName
|
||||
pubkey: root.publicKey
|
||||
colorHash: contactDetails.colorHash
|
||||
colorId: contactDetails.colorId
|
||||
image: Utils.addTimestampToURL(contactDetails.largeImage)
|
||||
interactive: false
|
||||
imageWidth: 60
|
||||
|
|
|
@ -12,6 +12,8 @@ StatusMenu {
|
|||
property alias emojiHash: header.emojiHash
|
||||
property alias name: header.displayName
|
||||
property alias icon: header.icon
|
||||
property alias colorHash: header.colorHash
|
||||
property alias colorId: header.colorId
|
||||
|
||||
property alias isEnsVerified: header.userIsEnsVerified
|
||||
|
||||
|
|
|
@ -204,6 +204,7 @@ Pane {
|
|||
qrCode: root.profileStore.getQrCodeSource(linkToProfile)
|
||||
displayName: userImage.name
|
||||
largeImage: userImage.image
|
||||
colorId: root.profileStore.colorId
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,6 +230,9 @@ Pane {
|
|||
pubkey: root.publicKey
|
||||
image: root.dirty ? root.dirtyValues.profileLargeImage
|
||||
: Utils.addTimestampToURL(contactDetails.largeImage)
|
||||
colorId: contactDetails.colorId
|
||||
colorHash: contactDetails.colorHash
|
||||
|
||||
interactive: false
|
||||
imageWidth: 90
|
||||
imageHeight: imageWidth
|
||||
|
|
|
@ -46,40 +46,15 @@ Item {
|
|||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
// This is used in the profile section. The user's pubkey is available
|
||||
// so we can calculate the hash and colorId
|
||||
Loader {
|
||||
id: profileSectionUserImage
|
||||
active: root.userPublicKey != ""
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
sourceComponent: UserImage {
|
||||
name: root.userDisplayName
|
||||
pubkey: root.userPublicKey
|
||||
image: root.userImage
|
||||
interactive: false
|
||||
imageWidth: 80
|
||||
imageHeight: 80
|
||||
}
|
||||
}
|
||||
|
||||
// This is used in the onboarding once a sync code is received. The
|
||||
// user's pubkey is unknown, but we have the multiaccount information
|
||||
// available (from the plaintext accounts db), so we use the colorHash
|
||||
// and colorId directly
|
||||
Loader {
|
||||
id: colorUserImage
|
||||
active: root.userPublicKey == ""
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
sourceComponent: UserImage {
|
||||
name: root.userDisplayName
|
||||
colorId: root.userColorId
|
||||
colorHash: root.userColorHash
|
||||
image: root.userImage
|
||||
interactive: false
|
||||
imageWidth: 80
|
||||
imageHeight: 80
|
||||
loading: name === ""
|
||||
}
|
||||
UserImage {
|
||||
name: root.userDisplayName
|
||||
colorId: root.userColorId
|
||||
colorHash: root.userColorHash
|
||||
image: root.userImage
|
||||
interactive: false
|
||||
imageWidth: 80
|
||||
imageHeight: 80
|
||||
loading: name === ""
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
|
|
|
@ -169,9 +169,11 @@ Loader {
|
|||
const isAdmin = false // chatContentModule.amIChatAdmin()
|
||||
|
||||
const params = { profileType, trustStatus, contactType, ensVerified, onlineStatus, hasLocalNickname, chatType, isAdmin,
|
||||
publicKey: isReply ? quotedMessageFrom : root.senderId,
|
||||
publicKey,
|
||||
displayName: isReply ? quotedMessageAuthorDetailsDisplayName : root.senderDisplayName,
|
||||
userIcon: isReply ? quotedMessageAuthorDetailsThumbnailImage : root.senderIcon,
|
||||
colorHash: isReply ? quotedMessageAuthorDetailsColorHash : root.senderColorHash,
|
||||
colorId: Utils.colorIdForPubkey(publicKey)
|
||||
}
|
||||
|
||||
Global.openMenu(profileContextMenuComponent, sender, params)
|
||||
|
@ -1192,35 +1194,35 @@ Loader {
|
|||
root.rootStore.chatCommunitySectionModule.createOneToOneChat("", profileContextMenu.publicKey, "")
|
||||
}
|
||||
onReviewContactRequest: () => {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.openReviewContactRequestPopup(profileContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onSendContactRequest: () => {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.openContactRequestPopup(profileContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onEditNickname: () => {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.openNicknamePopupRequested(profileContextMenu.publicKey, contactDetails, null)
|
||||
}
|
||||
onRemoveNickname: () => {
|
||||
root.rootStore.contactsStore.changeContactNickname(profileContextMenu.publicKey, "", profileContextMenu.displayName, true)
|
||||
}
|
||||
onUnblockContact: () => {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.unblockContactRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onMarkAsUntrusted: () => {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.markAsUntrustedRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onRemoveTrustStatus: root.rootStore.contactsStore.removeTrustStatus(profileContextMenu.publicKey)
|
||||
onRemoveContact: () => {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.removeContactRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onBlockContact: () => {
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true)
|
||||
const contactDetails = profileContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(profileContextMenu.publicKey, true, true, true)
|
||||
Global.blockContactRequested(profileContextMenu.publicKey, contactDetails)
|
||||
}
|
||||
onRemoveFromGroup: () => {
|
||||
|
|
|
@ -24,6 +24,8 @@ StatusMenu {
|
|||
property int chatType: Constants.chatType.unknown
|
||||
property bool isAdmin: false
|
||||
property var emojiHash: []
|
||||
property var colorHash: []
|
||||
property int colorId
|
||||
|
||||
signal openProfileClicked
|
||||
signal createOneToOneChat
|
||||
|
@ -45,6 +47,8 @@ StatusMenu {
|
|||
displayName: StatusQUtils.Emoji.parse(root.displayName, StatusQUtils.Emoji.size.verySmall)
|
||||
pubkey: root.publicKey
|
||||
emojiHash: root.emojiHash
|
||||
colorHash: root.colorHash
|
||||
colorId: root.colorId
|
||||
icon: root.userIcon
|
||||
trustStatus: root.profileType === Constants.profileType.regular ? root.trustStatus : Constants.trustStatus.unknown
|
||||
isContact: root.profileType === Constants.profileType.regular ? root.contactType === Constants.contactType.contact : false
|
||||
|
|
|
@ -19,6 +19,7 @@ StatusDialog {
|
|||
required property string qrCode
|
||||
required property string linkToProfile
|
||||
required property var emojiHash
|
||||
required property int colorId
|
||||
|
||||
required property string displayName
|
||||
required property string largeImage
|
||||
|
@ -58,9 +59,12 @@ StatusDialog {
|
|||
|
||||
UserImage {
|
||||
anchors.centerIn: parent
|
||||
|
||||
name: root.displayName
|
||||
pubkey: root.publicKey
|
||||
image: root.largeImage
|
||||
colorId: root.colorId
|
||||
|
||||
interactive: false
|
||||
imageWidth: 78
|
||||
imageHeight: 78
|
||||
|
|
|
@ -721,7 +721,7 @@ QtObject {
|
|||
icon: "",
|
||||
isCurrentUser: "",
|
||||
colorId: "",
|
||||
colorHash: "",
|
||||
colorHash: [],
|
||||
displayName: "",
|
||||
publicKey: publicKey,
|
||||
compressedPublicKey: "",
|
||||
|
|
Loading…
Reference in New Issue