getEmojiHashAsJson moved from Utils to UtilsStore

This commit is contained in:
Michał Cieślak 2024-10-22 14:39:42 +02:00 committed by Michał
parent f6f73c188a
commit 4c7205fc5d
33 changed files with 140 additions and 39 deletions

View File

@ -26,6 +26,7 @@ StackLayout {
id: root
property SharedStores.RootStore sharedRootStore
property SharedStores.UtilsStore utilsStore
property ChatStores.RootStore rootStore
property ChatStores.CreateChatPropertiesStore createChatPropertiesStore
readonly property ProfileStores.ContactsStore contactsStore: rootStore.contactsStore
@ -157,6 +158,7 @@ StackLayout {
stickersPopup: root.stickersPopup
contactsStore: root.contactsStore
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
rootStore: root.rootStore
createChatPropertiesStore: root.createChatPropertiesStore
communitiesStore: root.communitiesStore
@ -245,9 +247,12 @@ StackLayout {
root.isPrivilegedUser &&
(root.currentIndex === 1 || !!communitySettingsLoader.item) // lazy load and preserve state after loading
asynchronous: false // It's false on purpose. We want to load the component synchronously
sourceComponent: CommunitySettingsView {
id: communitySettingsView
rootStore: root.rootStore
utilsStore: root.utilsStore
walletAccountsModel: WalletStore.RootStore.nonWatchAccounts
enabledChainIds: WalletStore.RootStore.networkFilters
onEnableNetwork: WalletStore.RootStore.enableNetwork(chainId)

View File

@ -12,6 +12,8 @@ import shared 1.0
import shared.panels 1.0
import shared.status 1.0
import shared.views.chat 1.0
import shared.stores 1.0 as SharedStores
import utils 1.0
import SortFilterProxyModel 0.2
@ -22,6 +24,8 @@ Item {
id: root
property ChatStores.RootStore store
property SharedStores.UtilsStore utilsStore
property var usersModel
property string label
property int communityMemberReevaluationStatus: Constants.CommunityMemberReevaluationStatus.None
@ -126,6 +130,7 @@ Item {
Global.openMenu(profileContextMenuComponent, this, {
profileType, trustStatus, contactType, ensVerified, onlineStatus, hasLocalNickname, chatType, isAdmin,
publicKey: model.pubKey,
emojiHash: root.utilsStore.getEmojiHash(model.pubKey),
displayName: nickName || userName,
userIcon: model.icon,
})

View File

@ -20,6 +20,7 @@ StatusDialog {
id: root
property SharedStores.RootStore sharedStore
property SharedStores.UtilsStore utilsStore
property RootStore store
property MessageStore messageStore
property var pinnedMessagesModel //this doesn't belong to the messageStore, it is a part of the ChatContentStore, but we didn't introduce it yet.
@ -80,6 +81,7 @@ StatusDialog {
width: parent.width
sharedRootStore: root.sharedStore
utilsStore: root.utilsStore
rootStore: root.store
messageStore: root.messageStore

View File

@ -40,6 +40,7 @@ Item {
property var parentModule
property SharedStores.RootStore sharedRootStore
property SharedStores.UtilsStore utilsStore
property ChatStores.RootStore rootStore
property ChatStores.CreateChatPropertiesStore createChatPropertiesStore
property ProfileStores.ContactsStore contactsStore
@ -236,6 +237,7 @@ Item {
chatType: model.type
chatMessagesLoader.active: model.loaderActive
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
rootStore: root.rootStore
contactsStore: root.contactsStore
emojiPopup: root.emojiPopup

View File

@ -32,6 +32,8 @@ ColumnLayout {
property var chatContentModule
property var chatSectionModule
property SharedStores.RootStore sharedRootStore
property SharedStores.UtilsStore utilsStore
property RootStore rootStore
property ContactsStore contactsStore
property string chatId
@ -85,6 +87,7 @@ ColumnLayout {
chatContentModule: root.chatContentModule
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
rootStore: root.rootStore
contactsStore: root.contactsStore
messageStore: root.messageStore

View File

@ -32,6 +32,8 @@ Item {
property var chatContentModule
property SharedStores.RootStore sharedRootStore
property SharedStores.UtilsStore utilsStore
property RootStore rootStore
property MessageStore messageStore
property UsersStore usersStore
@ -271,6 +273,7 @@ Item {
objectName: "chatMessageViewDelegate"
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
rootStore: root.rootStore
messageStore: root.messageStore
usersStore: root.usersStore

View File

@ -43,6 +43,7 @@ StatusSectionLayout {
property bool hasAddedContacts: contactsStore.myContactsModel.count > 0
property SharedStores.RootStore sharedRootStore
property SharedStores.UtilsStore utilsStore
property ChatStores.RootStore rootStore
property ChatStores.CreateChatPropertiesStore createChatPropertiesStore
property CommunitiesStores.CommunitiesStore communitiesStore
@ -178,6 +179,7 @@ StatusSectionLayout {
UserListPanel {
anchors.fill: parent
store: root.rootStore
utilsStore: root.utilsStore
label: qsTr("Members")
communityMemberReevaluationStatus: root.rootStore.communityMemberReevaluationStatus
usersModel: {
@ -235,6 +237,7 @@ StatusSectionLayout {
ChatColumnView {
parentModule: root.rootStore.chatCommunitySectionModule
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
rootStore: root.rootStore
createChatPropertiesStore: root.createChatPropertiesStore
contactsStore: root.contactsStore

View File

@ -3,6 +3,8 @@ import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Controls 0.1
import shared.stores 1.0 as SharedStores
import utils 1.0
import AppLayouts.Chat.stores 1.0
@ -13,6 +15,8 @@ SettingsPage {
id: root
property RootStore rootStore
property SharedStores.UtilsStore utilsStore
property var membersModel
property var bannedMembersModel
property var pendingMembersModel
@ -109,6 +113,7 @@ SettingsPage {
MembersTabPanel {
model: root.membersModel
rootStore: root.rootStore
utilsStore: root.utilsStore
memberRole: root.memberRole
placeholderText: {
if (root.membersModel.ModelCount.count === 0)
@ -141,6 +146,7 @@ SettingsPage {
MembersTabPanel {
model: root.pendingMembersModel
rootStore: root.rootStore
utilsStore: root.utilsStore
memberRole: root.memberRole
placeholderText: {
if (root.pendingMembersModel.ModelCount.count === 0)
@ -160,6 +166,7 @@ SettingsPage {
MembersTabPanel {
model: root.declinedMembersModel
rootStore: root.rootStore
utilsStore: root.utilsStore
memberRole: root.memberRole
placeholderText: {
if (root.declinedMembersModel.ModelCount.count === 0)
@ -178,6 +185,7 @@ SettingsPage {
MembersTabPanel {
model: root.bannedMembersModel
rootStore: root.rootStore
utilsStore: root.utilsStore
memberRole: root.memberRole
placeholderText: {
if (root.bannedMembersModel.ModelCount.count === 0)

View File

@ -10,10 +10,11 @@ import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
import utils 1.0
import shared.views.chat 1.0
import shared.controls.chat 1.0
import shared.controls 1.0
import shared.controls.chat 1.0
import shared.stores 1.0 as SharedStores
import shared.views.chat 1.0
import utils 1.0
import AppLayouts.Chat.stores 1.0
import AppLayouts.Communities.layouts 1.0
@ -26,6 +27,8 @@ Item {
property string placeholderText
property var model
property RootStore rootStore
property SharedStores.UtilsStore utilsStore
property int memberRole: Constants.memberRole.none
readonly property bool isOwner: memberRole === Constants.memberRole.owner
@ -315,7 +318,7 @@ Item {
Global.openMenu(memberContextMenuComponent, this, {
profileType, trustStatus, contactType, ensVerified, onlineStatus, hasLocalNickname,
publicKey: model.pubKey,
publicKey: model.pubKey, emojiHash: root.utilsStore.getEmojiHash(model.pubKey),
displayName: memberItem.title || model.displayName,
userIcon: icon.name,
})

View File

@ -20,6 +20,7 @@ StatusDialog {
id: root
property SharedStores.RootStore sharedRootStore
property SharedStores.UtilsStore utilsStore
property ChatStores.RootStore rootStore
property var chatCommunitySectionModule
property var memberMessagesModel: chatCommunitySectionModule.memberMessagesModel
@ -65,6 +66,7 @@ StatusDialog {
width: parent.width
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
rootStore: root.rootStore
chatCommunitySectionModule: root.chatCommunitySectionModule
messageStore: root.rootStore.messageStore

View File

@ -36,6 +36,7 @@ StatusSectionLayout {
onNotificationButtonClicked: Global.openActivityCenterPopup()
property ChatStores.RootStore rootStore
property UtilsStore utilsStore
property var chatCommunitySectionModule
required property TokensStore tokensStore
required property var community
@ -295,10 +296,13 @@ StatusSectionLayout {
sourceComponent: MembersSettingsPanel {
rootStore: root.rootStore
utilsStore: root.utilsStore
membersModel: root.joinedMembers
bannedMembersModel: root.bannedMembers
pendingMembersModel: root.pendingMembers
declinedMembersModel: root.declinedMembers
editable: root.isAdmin || root.isOwner || root.isTokenMasterOwner
memberRole: community.memberRole
communityName: root.community.name

View File

@ -250,6 +250,7 @@ following the \"Add existing Status user\" flow, using your seed phrase.")
id: profileChatKeyViewComponent
ProfileChatKeyView {
startupStore: root.startupStore
utilsStore: root.utilsStore
}
}

View File

@ -8,10 +8,11 @@ import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Popups 0.1
import shared.panels 1.0
import shared 1.0
import shared.popups 1.0
import shared.controls 1.0
import shared.panels 1.0
import shared.popups 1.0
import shared.stores 1.0
import utils 1.0
import "../popups"
@ -23,6 +24,7 @@ Item {
objectName: "onboardingProfileChatKeyView"
property StartupStore startupStore
property UtilsStore utilsStore
Component.onCompleted: {
nextBtn.forceActiveFocus()
@ -125,7 +127,7 @@ Item {
bottom: parent.bottom
left: parent.left
}
publicKey: d.publicKey
emojiHash: root.utilsStore.getEmojiHash(d.publicKey)
objectName: "publicKeyEmojiHash"
}
StatusSmartIdenticon {

View File

@ -216,6 +216,7 @@ StatusSectionLayout {
implicitWidth: parent.width
implicitHeight: parent.height
contactsStore: root.store.contactsStore
utilsStore: root.utilsStore
sectionTitle: qsTr("Contacts")
contentWidth: d.contentWidth
}

View File

@ -9,10 +9,11 @@ import StatusQ.Core.Theme 0.1
import utils 1.0
import shared.views 1.0
import shared.controls 1.0
import shared.panels 1.0
import shared.popups 1.0
import shared.controls 1.0
import shared.stores 1.0 as SharedStores
import shared.views 1.0
import shared.views.chat 1.0
import "../stores"
@ -21,7 +22,10 @@ import "../popups"
SettingsContentBase {
id: root
property ContactsStore contactsStore
property SharedStores.UtilsStore utilsStore
property alias searchStr: searchBox.text
property bool isPending: false
@ -39,6 +43,7 @@ SettingsContentBase {
Global.openMenu(contactContextMenuComponent, this, {
profileType, trustStatus, contactType, ensVerified, onlineStatus, hasLocalNickname,
publicKey: publicKey,
emojiHash: root.utilsStore.getEmojiHash(publicKey),
displayName: name,
userIcon: icon,
})

View File

@ -406,6 +406,7 @@ SettingsContentBase {
publicKey: root.contactsStore.myPublicKey
profileStore: root.profileStore
contactsStore: root.contactsStore
utilsStore: root.utilsStore
sendToAccountEnabled: root.sendToAccountEnabled
onClosed: destroy()
dirtyValues: root.liveValues
@ -427,6 +428,7 @@ SettingsContentBase {
MyProfilePreview {
profileStore: root.profileStore
contactsStore: root.contactsStore
utilsStore: root.utilsStore
sendToAccountEnabled: root.sendToAccountEnabled
dirtyValues: root.liveValues
dirty: root.dirty

View File

@ -11,6 +11,8 @@ import shared.controls 1.0
Item {
property alias profileStore: profilePreview.profileStore
property alias contactsStore: profilePreview.contactsStore
property alias utilsStore: profilePreview.utilsStore
property alias sendToAccountEnabled: profilePreview.sendToAccountEnabled
property alias dirtyValues: profilePreview.dirtyValues
property alias dirty: profilePreview.dirty

View File

@ -876,6 +876,7 @@ Item {
x: profileButton.x + profileButton.width + 5
pubKey: appMain.profileStore.pubkey
emojiHash: appMain.utilsStore.getEmojiHash(pubKey)
name: appMain.profileStore.name
icon: appMain.profileStore.icon
isEnsVerified: !!appMain.profileStore.preferredName
@ -1371,6 +1372,7 @@ Item {
id: chatLayoutContainer
sharedRootStore: appMain.sharedRootStore
utilsStore: appMain.utilsStore
rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore
currencyStore: appMain.currencyStore
@ -1537,6 +1539,7 @@ Item {
communitySettingsDisabled: !chatLayoutComponent.isManageCommunityEnabledInAdvanced &&
(production && appMain.rootStore.profileSectionStore.walletStore.areTestNetworksEnabled)
sharedRootStore: appMain.sharedRootStore
utilsStore: appMain.utilsStore
rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore
currencyStore: appMain.currencyStore

View File

@ -414,7 +414,10 @@ QtObject {
readonly property list<Component> _components: [
Component {
id: removeContactConfirmationDialog
RemoveContactPopup {
utilsStore: root.utilsStore
onAccepted: {
rootStore.contactStore.removeContact(publicKey)
if (removeIDVerification)
@ -448,9 +451,10 @@ QtObject {
Component {
id: contactOutgoingVerificationRequestPopupComponent
OutgoingContactVerificationRequestPopup {
OutgoingContactVerificationRequestPopup {
profileStore: root.profileStore
utilsStore: root.utilsStore
onVerificationRequestCanceled: {
rootStore.contactStore.cancelVerificationRequest(publicKey)
@ -479,6 +483,8 @@ QtObject {
Component {
id: markAsIDVerifiedPopupComponent
MarkAsIDVerifiedDialog {
utilsStore: root.utilsStore
onAccepted: {
rootStore.contactStore.markAsTrusted(publicKey)
Global.displaySuccessToastMessage(qsTr("%1 ID verified").arg(mainDisplayName))
@ -491,6 +497,8 @@ QtObject {
Component {
id: removeIDVerificationPopupComponent
RemoveIDVerificationDialog {
utilsStore: root.utilsStore
onAccepted: {
rootStore.contactStore.removeTrustVerificationStatus(publicKey)
@ -527,6 +535,8 @@ QtObject {
SendContactRequestModal {
rootStore: root.rootStore
utilsStore: root.utilsStore
onAccepted: rootStore.contactStore.sendContactRequest(publicKey, message)
onClosed: destroy()
}
@ -535,6 +545,8 @@ QtObject {
Component {
id: reviewContactRequestPopupComponent
ReviewContactRequestPopup {
utilsStore: root.utilsStore
onAccepted: {
rootStore.contactStore.acceptContactRequest(publicKey, contactRequestId)
Global.displaySuccessToastMessage(qsTr("Contact request accepted"))
@ -589,6 +601,8 @@ QtObject {
profileStore: rootStore.profileSectionStore.profileStore
contactsStore: rootStore.profileSectionStore.contactsStore
utilsStore: root.utilsStore
sendToAccountEnabled: root.networkConnectionStore.sendBuyBridgeEnabled
showcaseCommunitiesModel: isCurrentUser ? rootStore.profileSectionStore.ownShowcaseCommunitiesModel : rootStore.profileSectionStore.contactShowcaseCommunitiesModel
@ -649,8 +663,10 @@ QtObject {
Component {
id: pinnedMessagesPopup
PinnedMessagesPopup {
sharedStore: root.sharedRootStore
utilsStore: root.utilsStore
onClosed: destroy()
}
},
@ -678,6 +694,8 @@ QtObject {
Component {
id: markAsUntrustedComponent
MarkAsUntrustedPopup {
utilsStore: root.utilsStore
onAccepted: {
rootStore.contactStore.markUntrustworthy(publicKey)
if (removeContact) {
@ -695,6 +713,8 @@ QtObject {
Component {
id: unblockContactConfirmationComponent
UnblockContactConfirmationDialog {
utilsStore: root.utilsStore
onAccepted: {
rootStore.contactStore.unblockContact(publicKey)
Global.displaySuccessToastMessage(qsTr("%1 unblocked").arg(mainDisplayName))
@ -707,6 +727,8 @@ QtObject {
Component {
id: blockContactConfirmationComponent
BlockContactConfirmationDialog {
utilsStore: root.utilsStore
onAccepted: {
rootStore.contactStore.blockContact(publicKey)
if (removeIDVerification)
@ -1245,6 +1267,7 @@ QtObject {
id: communityMemberMessagesPopup
CommunityMemberMessagesPopup {
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
onClosed: destroy()
}
},

View File

@ -1,16 +1,16 @@
import QtQuick 2.13
import QtQuick 2.15
import StatusQ.Core.Utils 0.1 as StatusQUtils
import StatusQ.Components 0.1
import utils 1.0
Item {
id: root
property bool compact: false
property bool oneRow
property string publicKey
// emoji hash in form of an array of emojis
property var emojiHash: []
readonly property real size: compact ? 10 : 15
@ -25,7 +25,7 @@ Item {
rowSpacing: root.compact ? 4 : 6
Repeater {
model: Utils.getEmojiHashAsJson(root.publicKey)
model: root.emojiHash
StatusEmoji {
width: root.size

View File

@ -8,6 +8,7 @@ import StatusQ.Components 0.1
import shared.controls 1.0
import shared.status 1.0
import shared.stores 1.0
import utils 1.0
import "./private"
@ -15,6 +16,8 @@ import "./private"
CalloutCard {
id: root
property UtilsStore utilsStore
readonly property LinkData linkData: LinkData { }
readonly property UserData userData: UserData { }
readonly property CommunityData communityData: CommunityData { }
@ -114,7 +117,7 @@ CalloutCard {
Layout.topMargin: 4
Layout.bottomMargin: 6
visible: root.type === Constants.LinkPreviewType.StatusContact
publicKey: root.userData.publicKey
emojiHash: root.utilsStore.getEmojiHash(root.userData.publicKey)
oneRow: true
objectName: "linkPreviewEmojiHash"
}

View File

@ -38,6 +38,7 @@ Item {
property bool displayNamePlusIconsVisible: false
property bool pubkeyVisible: true
property bool pubkeyVisibleWithCopy: false
property alias emojiHash: emojiHash.emojiHash
property bool emojiHashVisible: true
property bool editImageButtonVisible: false
property bool editButtonVisible: displayNamePlusIconsVisible
@ -276,7 +277,6 @@ Item {
Layout.alignment: Qt.AlignHCenter
visible: root.emojiHashVisible && !root.isBridgedAccount
compact: root.compact
publicKey: root.pubkey
}
}

View File

@ -9,13 +9,16 @@ import StatusQ.Controls 0.1
import StatusQ.Popups.Dialog 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils
import utils 1.0
import shared.controls 1.0
import shared.controls.chat 1.0
import shared.stores 1.0
import utils 1.0
StatusDialog {
id: root
required property UtilsStore utilsStore
required property string publicKey
required property var contactDetails
property bool loadingContactDetails
@ -114,7 +117,7 @@ StatusDialog {
}
EmojiHash {
Layout.topMargin: 4
publicKey: root.publicKey
emojiHash: root.utilsStore.getEmojiHash(root.publicKey)
oneRow: true
}
}

View File

@ -10,14 +10,11 @@ import StatusQ.Controls.Validators 0.1
import StatusQ.Popups.Dialog 0.1
import shared.controls 1.0
import shared.stores 1.0
import utils 1.0
CommonContactDialog {
id: root
property UtilsStore utilsStore
readonly property string nickname: contactDetails.localNickname
signal editDone(string newNickname)

View File

@ -15,6 +15,8 @@ StatusDialog {
property alias profileStore: profileView.profileStore
property alias contactsStore: profileView.contactsStore
property alias utilsStore: profileView.utilsStore
property alias sendToAccountEnabled: profileView.sendToAccountEnabled
property alias showcaseCommunitiesModel: profileView.showcaseCommunitiesModel

View File

@ -8,7 +8,8 @@ import utils 1.0
StatusMenu {
id: root
property string pubKey
property alias pubKey: header.pubkey
property alias emojiHash: header.emojiHash
property alias name: header.displayName
property alias icon: header.icon
@ -27,7 +28,6 @@ StatusMenu {
objectName: 'onlineIdentifierProfileHeader'
width: parent.width
pubkey: root.pubKey
}
StatusMenuSeparator {}

View File

@ -28,4 +28,12 @@ QtObject {
function isAlias(name) {
return d.globalUtilsInst.isAlias(name)
}
function getEmojiHash(publicKey) {
if (publicKey === "" || !isChatKey(publicKey))
return []
return JSON.parse(d.globalUtilsInst.getEmojiHashAsJson(publicKey))
}
}

View File

@ -12,13 +12,14 @@ import StatusQ.Popups 0.1
import StatusQ.Popups.Dialog 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils
import utils 1.0
import shared.controls 1.0
import shared.panels 1.0
import shared.popups 1.0
import shared.controls.chat 1.0
import shared.controls.chat.menuItems 1.0
import shared.panels 1.0
import shared.popups 1.0
import shared.stores 1.0 as SharedStores
import shared.views.profile 1.0
import utils 1.0
import SortFilterProxyModel 0.2
@ -37,6 +38,7 @@ Pane {
property ProfileStores.ProfileStore profileStore
property ProfileStores.ContactsStore contactsStore
property SharedStores.UtilsStore utilsStore
property alias sendToAccountEnabled: showcaseView.sendToAccountEnabled
@ -102,6 +104,8 @@ Pane {
readonly property bool isLocallyTrusted: contactDetails.trustStatus === Constants.trustStatus.trusted
readonly property string linkToProfile: root.contactsStore.getLinkToProfile(root.publicKey)
readonly property var emojiHash: root.utilsStore.getEmojiHash(root.publicKey)
}
Component {
@ -241,6 +245,7 @@ Pane {
destroyOnClose: true
title: d.isCurrentUser ? qsTr("Share your profile") : qsTr("%1's profile").arg(StatusQUtils.Emoji.parse(d.mainDisplayName))
publicKey: root.publicKey
emojiHash: d.emojiHash
linkToProfile: d.linkToProfile
qrCode: root.profileStore.getQrCodeSource(linkToProfile)
displayName: userImage.name
@ -552,7 +557,7 @@ Pane {
EmojiHash {
Layout.topMargin: Theme.halfPadding
objectName: "ProfileDialog_userEmojiHash"
publicKey: root.publicKey
emojiHash: d.emojiHash
oneRow: true
}
}

View File

@ -8,14 +8,17 @@ import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import shared.controls 1.0
import shared.status 1.0
import shared.panels 1.0
import shared.status 1.0
import shared.stores 1.0
import shared.controls.delegates 1.0
Flow {
id: root
property UtilsStore utilsStore
required property bool isOnline
required property bool playAnimations
@ -76,6 +79,9 @@ Flow {
model: root.linkPreviewModel
delegate: LinkPreviewCardDelegate {
id: delegate
utilsStore: root.utilsStore
highlight: url === root.highlightLink
onHoveredChanged: {
linksRepeater.hoveredUrl = hovered ? url : ""

View File

@ -25,6 +25,7 @@ Loader {
id: root
property SharedStores.RootStore sharedRootStore
property SharedStores.UtilsStore utilsStore
property ChatStores.RootStore rootStore
property ChatStores.MessageStore messageStore
property ChatStores.UsersStore usersStore
@ -954,6 +955,8 @@ Loader {
LinksMessageView {
id: linksMessageView
utilsStore: root.utilsStore
linkPreviewModel: root.linkPreviewModel
gifLinks: root.gifLinks
playAnimations: root.Window.active && root.messageStore.isChatActive

View File

@ -23,6 +23,7 @@ StatusMenu {
property bool hasLocalNickname: false
property int chatType: Constants.chatType.unknown
property bool isAdmin: false
property var emojiHash: []
signal openProfileClicked
signal createOneToOneChat
@ -43,6 +44,7 @@ StatusMenu {
editButtonVisible: false
displayName: StatusQUtils.Emoji.parse(root.displayName, StatusQUtils.Emoji.size.verySmall)
pubkey: root.publicKey
emojiHash: root.emojiHash
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

View File

@ -18,6 +18,7 @@ StatusDialog {
required property string publicKey
required property string qrCode
required property string linkToProfile
required property var emojiHash
required property string displayName
required property string largeImage
@ -131,11 +132,11 @@ StatusDialog {
background.color: "transparent"
background.border.color: Theme.palette.baseColor2
leftComponent: EmojiHash {
publicKey: root.publicKey
emojiHash: root.emojiHash
oneRow: true
}
rightComponent: CopyButton {
textToCopy: Utils.getEmojiHashAsJson(root.publicKey).join("").toString()
textToCopy: emojiHash.join("")
StatusToolTip {
text: qsTr("Copy emoji hash")
visible: parent.hovered

View File

@ -781,14 +781,6 @@ QtObject {
return mainModuleInst.isEnsVerified(publicKey)
}
function getEmojiHashAsJson(publicKey) {
if (publicKey === "" || !isChatKey(publicKey)) {
return ""
}
let jsonObj = globalUtilsInst.getEmojiHashAsJson(publicKey)
return JSON.parse(jsonObj)
}
function getColorHashAsJson(publicKey, skipEnsVerification=false) {
if (publicKey === "" || !isChatKey(publicKey))
return