2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-09-15 20:10:43 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2020-06-04 10:30:49 +00:00
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
2021-01-11 20:59:05 +00:00
|
|
|
import "../../../../shared/status"
|
2020-06-04 10:30:49 +00:00
|
|
|
import "./"
|
|
|
|
|
|
|
|
ModalPopup {
|
|
|
|
id: popup
|
2020-10-02 13:02:56 +00:00
|
|
|
|
|
|
|
property Popup parentPopup
|
|
|
|
|
2020-09-17 14:26:26 +00:00
|
|
|
property var identicon: ""
|
|
|
|
property var userName: ""
|
2020-09-24 18:12:50 +00:00
|
|
|
property string nickname: ""
|
2020-09-17 14:26:26 +00:00
|
|
|
property var fromAuthor: ""
|
|
|
|
property var text: ""
|
|
|
|
property var alias: ""
|
2021-01-12 20:51:00 +00:00
|
|
|
|
|
|
|
readonly property int innerMargin: 20
|
2020-07-09 17:47:36 +00:00
|
|
|
|
2020-06-30 18:18:04 +00:00
|
|
|
property bool isEnsVerified: false
|
2020-07-09 17:12:28 +00:00
|
|
|
property bool noFooter: false
|
2020-12-02 09:10:22 +00:00
|
|
|
property bool isBlocked: false
|
2020-06-17 21:43:26 +00:00
|
|
|
|
2020-08-10 11:56:16 +00:00
|
|
|
signal blockButtonClicked(name: string, address: string)
|
2020-12-02 09:10:22 +00:00
|
|
|
signal unblockButtonClicked(name: string, address: string)
|
2020-08-10 12:15:57 +00:00
|
|
|
signal removeButtonClicked(address: string)
|
2020-08-10 11:56:16 +00:00
|
|
|
|
2020-12-02 09:10:22 +00:00
|
|
|
signal contactUnblocked(publicKey: string)
|
2020-10-02 14:37:51 +00:00
|
|
|
signal contactBlocked(publicKey: string)
|
|
|
|
signal contactAdded(publicKey: string)
|
|
|
|
signal contactRemoved(publicKey: string)
|
|
|
|
|
2021-01-12 20:51:00 +00:00
|
|
|
clip: true
|
|
|
|
noTopMargin: true
|
|
|
|
|
2020-10-02 14:37:51 +00:00
|
|
|
function openPopup(showFooter, userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam) {
|
2020-09-16 18:50:40 +00:00
|
|
|
userName = userNameParam || ""
|
2020-09-16 19:52:48 +00:00
|
|
|
nickname = nicknameParam || ""
|
2020-09-16 18:50:40 +00:00
|
|
|
fromAuthor = fromAuthorParam || ""
|
|
|
|
identicon = identiconParam || ""
|
|
|
|
text = textParam || ""
|
2021-06-17 13:51:59 +00:00
|
|
|
isEnsVerified = chatsModel.ensView.isEnsVerified(this.fromAuthor)
|
2020-12-06 22:15:51 +00:00
|
|
|
isBlocked = profileModel.contacts.isContactBlocked(this.fromAuthor);
|
2020-09-16 18:50:40 +00:00
|
|
|
alias = chatsModel.alias(this.fromAuthor) || ""
|
2020-10-02 14:37:51 +00:00
|
|
|
|
2020-10-02 13:02:56 +00:00
|
|
|
noFooter = !showFooter;
|
2020-06-17 21:43:26 +00:00
|
|
|
popup.open()
|
|
|
|
}
|
2020-06-09 10:05:25 +00:00
|
|
|
|
|
|
|
header: Item {
|
2021-01-12 20:51:00 +00:00
|
|
|
height: 78
|
2020-06-23 19:04:08 +00:00
|
|
|
width: parent.width
|
2021-01-12 20:51:00 +00:00
|
|
|
|
2020-11-30 17:03:52 +00:00
|
|
|
RoundedImage {
|
2020-06-23 19:04:08 +00:00
|
|
|
id: profilePic
|
|
|
|
width: 40
|
|
|
|
height: 40
|
2020-11-30 17:03:52 +00:00
|
|
|
border.color: Style.current.border
|
2020-06-23 19:04:08 +00:00
|
|
|
border.width: 1
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-11-30 17:03:52 +00:00
|
|
|
source: identicon
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
|
|
|
|
2021-02-15 16:25:07 +00:00
|
|
|
StyledText {
|
2020-06-23 19:04:08 +00:00
|
|
|
id: profileName
|
2021-02-15 16:25:07 +00:00
|
|
|
text: Utils.removeStatusEns(userName)
|
|
|
|
elide: Text.ElideRight
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.top: parent.top
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.left: profilePic.right
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.leftMargin: Style.current.halfPadding
|
2021-02-15 16:25:07 +00:00
|
|
|
anchors.right: qrCodeButton.left
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-06-23 19:04:08 +00:00
|
|
|
font.bold: true
|
2021-01-12 20:51:00 +00:00
|
|
|
font.pixelSize: 17
|
2020-06-09 10:05:25 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 19:04:08 +00:00
|
|
|
StyledText {
|
2021-02-15 16:25:07 +00:00
|
|
|
text: isEnsVerified ? alias : fromAuthor
|
|
|
|
elide: !isEnsVerified ? Text.ElideMiddle : Text.ElideRight
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.left: profilePic.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: Style.current.padding
|
|
|
|
anchors.right: qrCodeButton.left
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.topMargin: 2
|
|
|
|
font.pixelSize: 14
|
2020-09-15 20:10:43 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
2020-06-09 10:05:25 +00:00
|
|
|
|
2021-01-12 16:48:03 +00:00
|
|
|
StatusIconButton {
|
2021-01-12 20:51:00 +00:00
|
|
|
id: qrCodeButton
|
2021-01-12 16:48:03 +00:00
|
|
|
icon.name: "qr-code-icon"
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.verticalCenter: profileName.verticalCenter
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.right: parent.right
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.rightMargin: 52
|
2021-01-12 16:48:03 +00:00
|
|
|
iconColor: Style.current.textColor
|
|
|
|
onClicked: qrCodePopup.open()
|
|
|
|
width: 32
|
|
|
|
height: 32
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
2020-12-04 13:51:25 +00:00
|
|
|
|
2021-01-12 20:51:00 +00:00
|
|
|
Separator {
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
}
|
|
|
|
|
2020-12-04 16:01:38 +00:00
|
|
|
ModalPopup {
|
2020-12-04 13:51:25 +00:00
|
|
|
id: qrCodePopup
|
2020-12-04 16:01:38 +00:00
|
|
|
width: 320
|
|
|
|
height: 320
|
2020-12-04 13:51:25 +00:00
|
|
|
Image {
|
|
|
|
asynchronous: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
source: profileModel.qrCode(fromAuthor)
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
height: 212
|
|
|
|
width: 212
|
|
|
|
mipmap: true
|
|
|
|
smooth: false
|
|
|
|
}
|
|
|
|
}
|
2020-06-09 10:05:25 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 17:17:58 +00:00
|
|
|
Item {
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.fill: parent
|
2020-06-04 10:30:49 +00:00
|
|
|
|
2021-01-12 20:51:00 +00:00
|
|
|
TextWithLabel {
|
|
|
|
id: ensText
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "ENS username"
|
2021-01-12 20:51:00 +00:00
|
|
|
label: qsTrId("ens-username")
|
|
|
|
text: userName
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.top: parent.top
|
2020-06-30 18:18:04 +00:00
|
|
|
visible: isEnsVerified
|
2021-01-12 20:51:00 +00:00
|
|
|
height: visible ? implicitHeight : 0
|
|
|
|
textToCopy: userName
|
2020-06-29 15:23:28 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 19:04:08 +00:00
|
|
|
StyledText {
|
|
|
|
id: labelChatKey
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Chat key"
|
|
|
|
text: qsTrId("chat-key")
|
2020-06-23 19:04:08 +00:00
|
|
|
font.pixelSize: 13
|
|
|
|
font.weight: Font.Medium
|
2020-09-15 20:10:43 +00:00
|
|
|
color: Style.current.secondaryText
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.top: ensText.bottom
|
|
|
|
anchors.topMargin: ensText.visible ? popup.innerMargin : 0
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
2020-06-04 10:30:49 +00:00
|
|
|
|
2020-08-27 18:02:28 +00:00
|
|
|
Address {
|
2020-06-23 19:04:08 +00:00
|
|
|
id: valueChatKey
|
|
|
|
text: fromAuthor
|
|
|
|
width: 160
|
2020-08-27 18:02:28 +00:00
|
|
|
maxWidth: parent.width - (3 * Style.current.smallPadding) - copyBtn.width
|
|
|
|
color: Style.current.textColor
|
2021-01-12 20:51:00 +00:00
|
|
|
font.pixelSize: 15
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.top: labelChatKey.bottom
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.topMargin: 4
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
2020-06-23 17:17:58 +00:00
|
|
|
|
2020-07-09 15:19:10 +00:00
|
|
|
CopyToClipBoardButton {
|
2020-08-27 18:02:28 +00:00
|
|
|
id: copyBtn
|
2020-07-09 15:19:10 +00:00
|
|
|
anchors.top: labelChatKey.bottom
|
|
|
|
anchors.left: valueChatKey.right
|
|
|
|
textToCopy: valueChatKey.text
|
2020-06-29 15:23:28 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 19:04:08 +00:00
|
|
|
Separator {
|
|
|
|
id: separator
|
|
|
|
anchors.top: valueChatKey.bottom
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.topMargin: popup.innerMargin
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: -Style.current.padding
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.right: parent.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: -Style.current.padding
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
2020-06-09 10:05:25 +00:00
|
|
|
|
2021-01-12 20:51:00 +00:00
|
|
|
TextWithLabel {
|
2020-06-23 19:04:08 +00:00
|
|
|
id: valueShareURL
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Share Profile URL"
|
|
|
|
label: qsTrId("share-profile-url")
|
2021-03-09 17:59:41 +00:00
|
|
|
text: Constants.userLinkPrefix + fromAuthor.substr(0, 4) + "..." + fromAuthor.substr(fromAuthor.length - 5)
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.top: separator.top
|
|
|
|
anchors.topMargin: popup.innerMargin
|
2021-03-09 17:59:41 +00:00
|
|
|
textToCopy: Constants.userLinkPrefix + fromAuthor
|
2020-06-29 15:23:28 +00:00
|
|
|
}
|
2020-09-15 20:10:43 +00:00
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator2
|
|
|
|
anchors.top: valueShareURL.bottom
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.topMargin: popup.innerMargin
|
2020-09-15 20:10:43 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
}
|
|
|
|
|
2021-01-12 20:51:00 +00:00
|
|
|
TextWithLabel {
|
2020-09-15 20:10:43 +00:00
|
|
|
id: chatSettings
|
2021-05-03 21:19:46 +00:00
|
|
|
visible: profileModel.profile.pubKey !== fromAuthor
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Chat settings"
|
2021-01-12 20:51:00 +00:00
|
|
|
label: qsTrId("chat-settings")
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Nickname"
|
|
|
|
text: qsTrId("nickname")
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.top: separator2.top
|
|
|
|
anchors.topMargin: popup.innerMargin
|
2020-09-15 20:10:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: nicknameCaret
|
2021-05-03 21:19:46 +00:00
|
|
|
visible: profileModel.profile.pubKey !== fromAuthor
|
2020-09-15 20:10:43 +00:00
|
|
|
source: "../../../img/caret.svg"
|
|
|
|
rotation: -90
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.bottom: chatSettings.bottom
|
|
|
|
anchors.bottomMargin: 5
|
2020-09-15 20:10:43 +00:00
|
|
|
width: 13
|
2021-03-03 13:52:51 +00:00
|
|
|
height: 7
|
2020-09-15 20:10:43 +00:00
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: parent
|
|
|
|
source: parent
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
2020-09-16 18:50:40 +00:00
|
|
|
id: nicknameText
|
2021-05-03 21:19:46 +00:00
|
|
|
visible: profileModel.profile.pubKey !== fromAuthor
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "None"
|
|
|
|
text: nickname ? nickname : qsTrId("none")
|
2020-09-15 20:10:43 +00:00
|
|
|
anchors.right: nicknameCaret.left
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.verticalCenter: nicknameCaret.verticalCenter
|
2020-09-15 20:10:43 +00:00
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.left: chatSettings.left
|
2020-09-15 20:10:43 +00:00
|
|
|
anchors.right: nicknameCaret.right
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.top: chatSettings.top
|
|
|
|
anchors.bottom: chatSettings.bottom
|
2020-09-15 20:10:43 +00:00
|
|
|
onClicked: {
|
2020-09-16 16:00:21 +00:00
|
|
|
nicknamePopup.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
NicknamePopup {
|
|
|
|
id: nicknamePopup
|
2020-09-28 14:31:00 +00:00
|
|
|
changeUsername: function (newUsername) {
|
|
|
|
popup.userName = newUsername
|
|
|
|
}
|
|
|
|
changeNickname: function (newNickname) {
|
|
|
|
popup.nickname = newNickname
|
|
|
|
}
|
2020-09-15 20:10:43 +00:00
|
|
|
}
|
2020-06-29 15:23:28 +00:00
|
|
|
}
|
2020-06-09 10:05:25 +00:00
|
|
|
|
2020-06-11 08:22:20 +00:00
|
|
|
footer: Item {
|
2020-07-09 17:12:28 +00:00
|
|
|
id: footerContainer
|
|
|
|
visible: !noFooter
|
2020-06-11 08:22:20 +00:00
|
|
|
width: parent.width
|
|
|
|
height: children[0].height
|
|
|
|
|
2021-01-11 20:59:05 +00:00
|
|
|
StatusButton {
|
|
|
|
id: blockBtn
|
|
|
|
anchors.right: addToContactsButton.left
|
|
|
|
anchors.rightMargin: addToContactsButton ? Style.current.padding : 0
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.bottom: parent.bottom
|
2021-01-28 11:04:10 +00:00
|
|
|
type: "warn"
|
2021-01-11 20:59:05 +00:00
|
|
|
showBorder: true
|
2021-01-28 11:04:10 +00:00
|
|
|
bgColor: "transparent"
|
2021-01-11 20:59:05 +00:00
|
|
|
borderColor: Style.current.border
|
2021-01-28 11:04:10 +00:00
|
|
|
hoveredBorderColor: Style.current.transparent
|
2021-01-11 20:59:05 +00:00
|
|
|
text: isBlocked ?
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Unblock User"
|
|
|
|
qsTrId("unblock-user") :
|
|
|
|
//% "Block User"
|
|
|
|
qsTrId("block-user")
|
2020-10-02 14:37:51 +00:00
|
|
|
onClicked: {
|
2020-12-02 09:10:22 +00:00
|
|
|
if (isBlocked) {
|
2020-12-07 15:23:52 +00:00
|
|
|
unblockContactConfirmationDialog.contactName = userName;
|
|
|
|
unblockContactConfirmationDialog.contactAddress = fromAuthor;
|
2020-12-02 09:10:22 +00:00
|
|
|
unblockContactConfirmationDialog.open();
|
|
|
|
return;
|
|
|
|
}
|
2020-10-02 14:37:51 +00:00
|
|
|
blockContactConfirmationDialog.contactName = userName;
|
|
|
|
blockContactConfirmationDialog.contactAddress = fromAuthor;
|
2021-01-11 20:59:05 +00:00
|
|
|
blockContactConfirmationDialog.open();
|
2020-10-02 14:37:51 +00:00
|
|
|
}
|
2020-06-04 10:30:49 +00:00
|
|
|
}
|
2020-06-11 08:22:20 +00:00
|
|
|
|
2021-01-11 20:59:05 +00:00
|
|
|
StatusButton {
|
|
|
|
property bool isAdded: profileModel.contacts.isAdded(fromAuthor)
|
|
|
|
|
2020-06-23 19:04:08 +00:00
|
|
|
id: addToContactsButton
|
2021-01-11 20:59:05 +00:00
|
|
|
anchors.right: sendMessageBtn.left
|
|
|
|
anchors.rightMargin: sendMessageBtn.visible ? Style.current.padding : 0
|
|
|
|
text: isAdded ?
|
|
|
|
//% "Remove Contact"
|
|
|
|
qsTrId("remove-contact") :
|
|
|
|
//% "Add to contacts"
|
|
|
|
qsTrId("add-to-contacts")
|
2020-06-23 19:04:08 +00:00
|
|
|
anchors.bottom: parent.bottom
|
2021-01-28 11:04:10 +00:00
|
|
|
type: isAdded ? "warn" : "primary"
|
2021-01-11 20:59:05 +00:00
|
|
|
showBorder: isAdded
|
|
|
|
borderColor: Style.current.border
|
2021-01-28 11:04:10 +00:00
|
|
|
bgColor: isAdded ? "transparent" : Style.current.buttonBackgroundColor
|
|
|
|
hoveredBorderColor: Style.current.transparent
|
2020-12-02 09:10:22 +00:00
|
|
|
visible: !isBlocked
|
2021-01-11 20:59:05 +00:00
|
|
|
width: visible ? implicitWidth : 0
|
2020-06-23 19:04:08 +00:00
|
|
|
onClicked: {
|
2020-12-06 22:15:51 +00:00
|
|
|
if (profileModel.contacts.isAdded(fromAuthor)) {
|
2020-10-02 14:37:51 +00:00
|
|
|
removeContactConfirmationDialog.parentPopup = profilePopup;
|
|
|
|
removeContactConfirmationDialog.open();
|
2020-06-23 19:04:08 +00:00
|
|
|
} else {
|
2020-12-06 22:15:51 +00:00
|
|
|
profileModel.contacts.addContact(fromAuthor);
|
2020-10-02 14:37:51 +00:00
|
|
|
contactAdded(fromAuthor);
|
|
|
|
profilePopup.close();
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
2020-06-19 17:18:04 +00:00
|
|
|
}
|
2020-06-23 19:04:08 +00:00
|
|
|
}
|
2021-01-11 20:59:05 +00:00
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: sendMessageBtn
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Send message"
|
2021-01-11 20:59:05 +00:00
|
|
|
text: qsTrId("send-message")
|
|
|
|
visible: !isBlocked && chatsModel.activeChannel.id !== popup.fromAuthor
|
|
|
|
width: visible ? implicitWidth : 0
|
|
|
|
onClicked: {
|
2021-04-26 06:18:28 +00:00
|
|
|
appMain.changeAppSection(Constants.chat)
|
2021-05-10 15:30:36 +00:00
|
|
|
chatsModel.joinPrivateChat(fromAuthor, "");
|
2021-01-11 20:59:05 +00:00
|
|
|
popup.close()
|
|
|
|
}
|
|
|
|
}
|
2021-01-12 20:51:00 +00:00
|
|
|
|
|
|
|
BlockContactConfirmationDialog {
|
|
|
|
id: blockContactConfirmationDialog
|
|
|
|
onBlockButtonClicked: {
|
|
|
|
profileModel.contacts.blockContact(fromAuthor)
|
|
|
|
blockContactConfirmationDialog.close();
|
|
|
|
popup.close()
|
|
|
|
|
|
|
|
contactBlocked(fromAuthor)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UnblockContactConfirmationDialog {
|
|
|
|
id: unblockContactConfirmationDialog
|
|
|
|
onUnblockButtonClicked: {
|
2021-01-28 11:23:56 +00:00
|
|
|
profileModel.contacts.unblockContact(fromAuthor)
|
2021-01-12 20:51:00 +00:00
|
|
|
unblockContactConfirmationDialog.close();
|
|
|
|
popup.close()
|
|
|
|
contactUnblocked(fromAuthor)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ConfirmationDialog {
|
|
|
|
id: removeContactConfirmationDialog
|
|
|
|
// % "Remove contact"
|
|
|
|
title: qsTrId("remove-contact")
|
|
|
|
//% "Are you sure you want to remove this contact?"
|
|
|
|
confirmationText: qsTrId("are-you-sure-you-want-to-remove-this-contact-")
|
|
|
|
onConfirmButtonClicked: {
|
|
|
|
if (profileModel.contacts.isAdded(fromAuthor)) {
|
|
|
|
profileModel.contacts.removeContact(fromAuthor);
|
|
|
|
}
|
|
|
|
removeContactConfirmationDialog.close();
|
|
|
|
popup.close();
|
|
|
|
|
|
|
|
contactRemoved(fromAuthor);
|
|
|
|
}
|
|
|
|
}
|
2020-06-04 10:30:49 +00:00
|
|
|
}
|
|
|
|
}
|