2022-11-15 10:11:55 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1 as CoreUtils
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import "../panels"
|
|
|
|
|
|
|
|
ActivityNotificationMessage {
|
|
|
|
id: root
|
|
|
|
|
2022-12-30 09:08:25 +00:00
|
|
|
Connections {
|
2023-03-14 10:09:05 +00:00
|
|
|
target: root.isOutgoingMessage ? root.store.contactsStore.sentContactRequestsModel :
|
2022-12-30 09:08:25 +00:00
|
|
|
root.store.contactsStore.receivedContactRequestsModel
|
|
|
|
|
|
|
|
function onItemChanged(pubKey) {
|
|
|
|
if (pubKey === root.contactId)
|
|
|
|
root.updateContactDetails()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-15 10:11:55 +00:00
|
|
|
messageDetails.messageText: {
|
|
|
|
if (!notification)
|
|
|
|
return ""
|
|
|
|
|
2023-03-14 10:09:05 +00:00
|
|
|
return root.isOutgoingMessage ? notification.repliedMessage.messageText : notification.message.messageText
|
2022-11-15 10:11:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
messageSubheaderComponent: StatusBaseText {
|
|
|
|
text: {
|
|
|
|
if (!notification)
|
|
|
|
return ""
|
|
|
|
|
2023-03-14 10:09:05 +00:00
|
|
|
if (root.isOutgoingMessage) {
|
2022-11-15 10:11:55 +00:00
|
|
|
return qsTr("To verify their identity you asked: %1").arg(CoreUtils.Utils.stripHtmlTags(notification.message.messageText))
|
|
|
|
}
|
|
|
|
|
|
|
|
return qsTr("Identity Verification Question:")
|
|
|
|
}
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.italic: true
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
2023-03-14 10:09:05 +00:00
|
|
|
ctaComponent: isOutgoingMessage ? outgoingContactVerificationCta : incomingContactVerificationCta
|
2022-11-15 10:11:55 +00:00
|
|
|
|
2024-03-12 14:24:55 +00:00
|
|
|
onMessageClicked: {
|
|
|
|
root.openProfilePopup()
|
|
|
|
}
|
|
|
|
|
2022-11-15 10:11:55 +00:00
|
|
|
Component {
|
|
|
|
id: outgoingContactVerificationCta
|
|
|
|
|
|
|
|
OutgoingContactVerificationCta {
|
|
|
|
verificationStatus: notification ? notification.verificationStatus : Constants.verificationStatus.unverified
|
|
|
|
onActivate: {
|
2024-02-26 18:54:05 +00:00
|
|
|
Global.openOutgoingIDRequestPopup(root.contactId, root.contactDetails, null)
|
2022-11-15 10:11:55 +00:00
|
|
|
root.closeActivityCenter()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: incomingContactVerificationCta
|
|
|
|
|
|
|
|
IncomingContactVerificationCta {
|
|
|
|
verificationStatus: notification ? notification.verificationStatus : Constants.verificationStatus.unverified
|
|
|
|
onActivate: {
|
2024-02-26 18:54:05 +00:00
|
|
|
Global.openIncomingIDRequestPopup(root.contactId, root.contactDetails, null)
|
2022-11-15 10:11:55 +00:00
|
|
|
root.closeActivityCenter()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-26 18:54:05 +00:00
|
|
|
}
|