2020-08-03 17:17:03 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQml.Models 2.3
|
2021-08-16 09:11:43 +00:00
|
|
|
import QtQuick.Dialogs 1.0
|
2021-08-06 15:44:57 +00:00
|
|
|
|
|
|
|
import StatusQ.Popups 0.1
|
2021-10-20 22:47:23 +00:00
|
|
|
import StatusQ.Components 0.1
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.status 1.0
|
2021-10-28 20:23:30 +00:00
|
|
|
import shared.controls.chat 1.0
|
2020-08-03 17:17:03 +00:00
|
|
|
|
2021-08-06 15:44:57 +00:00
|
|
|
StatusPopupMenu {
|
2021-10-21 00:41:54 +00:00
|
|
|
id: root
|
2021-08-06 15:44:57 +00:00
|
|
|
width: emojiContainer.visible ? emojiContainer.width : 176
|
2021-07-16 15:02:47 +00:00
|
|
|
|
2021-10-21 00:41:54 +00:00
|
|
|
property var store
|
2021-12-09 16:25:38 +00:00
|
|
|
// Important:
|
|
|
|
// We're here in case of ChatSection
|
|
|
|
// This module is set from `ChatLayout` (each `ChatLayout` has its own chatSectionModule)
|
|
|
|
property var chatSectionModule
|
2021-05-25 19:34:46 +00:00
|
|
|
property string messageId
|
2021-07-20 15:26:41 +00:00
|
|
|
property int contentType
|
2020-08-03 17:17:03 +00:00
|
|
|
property bool isProfile: false
|
2020-08-27 23:26:12 +00:00
|
|
|
property bool isSticker: false
|
2020-12-08 12:34:02 +00:00
|
|
|
property bool emojiOnly: false
|
2021-05-25 19:34:46 +00:00
|
|
|
property bool hideEmojiPicker: false
|
|
|
|
property bool pinnedMessage: false
|
2021-08-16 12:35:24 +00:00
|
|
|
property bool pinnedPopup: false
|
2021-06-29 14:49:32 +00:00
|
|
|
property bool isText: false
|
|
|
|
property bool isCurrentUser: false
|
2021-08-16 09:11:43 +00:00
|
|
|
property bool isRightClickOnImage: false
|
2021-02-23 10:18:09 +00:00
|
|
|
property string linkUrls: ""
|
2021-02-01 21:29:35 +00:00
|
|
|
property alias emojiContainer: emojiContainer
|
2020-10-02 13:02:56 +00:00
|
|
|
property var identicon: ""
|
|
|
|
property var userName: ""
|
|
|
|
property string nickname: ""
|
|
|
|
property var fromAuthor: ""
|
|
|
|
property var text: ""
|
2021-02-01 20:37:50 +00:00
|
|
|
property var emojiReactionsReactedByUser: []
|
2021-06-29 14:49:32 +00:00
|
|
|
property var onClickEdit: function(){}
|
2021-07-16 15:02:47 +00:00
|
|
|
property var reactionModel
|
2021-08-16 09:11:43 +00:00
|
|
|
property string imageSource: ""
|
2021-08-25 20:31:00 +00:00
|
|
|
property var setXPosition: function() {return 0}
|
|
|
|
property var setYPosition: function() {return 0}
|
2021-07-26 17:27:09 +00:00
|
|
|
property bool canPin: {
|
2021-10-21 00:41:54 +00:00
|
|
|
const nbPinnedMessages = root.store.chatsModelInst.messageView.pinnedMessagesList.count
|
2021-07-26 17:27:09 +00:00
|
|
|
return nbPinnedMessages < Constants.maxNumberOfPins
|
|
|
|
}
|
2021-06-29 14:49:32 +00:00
|
|
|
|
2021-08-25 20:31:00 +00:00
|
|
|
onHeightChanged: {
|
2021-10-21 00:41:54 +00:00
|
|
|
root.y = setYPosition()
|
2021-08-25 20:31:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onWidthChanged: {
|
2021-10-21 00:41:54 +00:00
|
|
|
root.x = setXPosition()
|
2021-08-25 20:31:00 +00:00
|
|
|
}
|
|
|
|
|
2021-08-16 12:35:24 +00:00
|
|
|
signal shouldCloseParentPopup
|
2021-07-22 07:47:15 +00:00
|
|
|
|
2021-02-01 20:37:50 +00:00
|
|
|
function show(userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam, emojiReactionsModel) {
|
2020-10-02 13:02:56 +00:00
|
|
|
userName = userNameParam || ""
|
|
|
|
nickname = nicknameParam || ""
|
|
|
|
fromAuthor = fromAuthorParam || ""
|
|
|
|
identicon = identiconParam || ""
|
|
|
|
text = textParam || ""
|
2021-02-01 20:37:50 +00:00
|
|
|
let newEmojiReactions = []
|
|
|
|
if (!!emojiReactionsModel) {
|
|
|
|
emojiReactionsModel.forEach(function (emojiReaction) {
|
|
|
|
newEmojiReactions[emojiReaction.emojiId] = emojiReaction.currentUserReacted
|
|
|
|
})
|
|
|
|
}
|
2021-07-16 15:02:47 +00:00
|
|
|
emojiReactionsReactedByUser = newEmojiReactions;
|
2021-02-01 20:37:50 +00:00
|
|
|
|
2021-08-06 15:44:57 +00:00
|
|
|
/* // copy link feature not ready yet
|
2021-10-21 00:41:54 +00:00
|
|
|
const numLinkUrls = root.linkUrls.split(" ").length
|
2021-02-23 10:18:09 +00:00
|
|
|
copyLinkMenu.enabled = numLinkUrls > 1
|
2021-10-21 00:41:54 +00:00
|
|
|
copyLinkAction.enabled = !!root.linkUrls && numLinkUrls === 1 && !emojiOnly && !root.isProfile
|
2021-08-06 15:44:57 +00:00
|
|
|
*/
|
2021-07-22 07:47:15 +00:00
|
|
|
popup()
|
2020-10-02 13:02:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-30 20:39:48 +00:00
|
|
|
function openProfileClicked() {
|
|
|
|
openProfilePopup(userName, fromAuthor, identicon, "", nickname);
|
|
|
|
}
|
|
|
|
|
2020-08-03 17:17:03 +00:00
|
|
|
Item {
|
|
|
|
id: emojiContainer
|
|
|
|
width: emojiRow.width
|
|
|
|
height: visible ? emojiRow.height : 0
|
2021-10-21 00:41:54 +00:00
|
|
|
visible: !hideEmojiPicker && (root.emojiOnly || !root.isProfile)
|
2020-08-03 17:17:03 +00:00
|
|
|
Row {
|
|
|
|
id: emojiRow
|
2021-08-06 15:44:57 +00:00
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
leftPadding: Style.current.halfPadding
|
|
|
|
rightPadding: Style.current.halfPadding
|
2021-10-21 00:41:54 +00:00
|
|
|
bottomPadding: root.emojiOnly ? 0 : Style.current.padding
|
2020-08-03 17:17:03 +00:00
|
|
|
|
|
|
|
Repeater {
|
2021-10-21 00:41:54 +00:00
|
|
|
model: root.reactionModel
|
2020-08-03 17:17:03 +00:00
|
|
|
delegate: EmojiReaction {
|
2021-09-28 15:04:06 +00:00
|
|
|
source: Style.svg(filename)
|
2020-08-03 17:17:03 +00:00
|
|
|
emojiId: model.emojiId
|
2021-10-21 00:41:54 +00:00
|
|
|
reactedByUser: !!root.emojiReactionsReactedByUser[model.emojiId]
|
2021-10-01 15:58:36 +00:00
|
|
|
onCloseModal: {
|
|
|
|
chatsModel.toggleReaction(SelectedMessage.messageId, emojiId)
|
2021-10-21 00:41:54 +00:00
|
|
|
root.close()
|
2020-08-12 17:58:19 +00:00
|
|
|
}
|
2020-08-03 17:17:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-16 15:02:47 +00:00
|
|
|
Item {
|
2020-08-03 17:17:03 +00:00
|
|
|
id: profileHeader
|
2021-10-21 00:41:54 +00:00
|
|
|
visible: root.isProfile
|
2021-08-06 15:44:57 +00:00
|
|
|
width: parent.width
|
2020-08-03 17:17:03 +00:00
|
|
|
height: visible ? profileImage.height + username.height + Style.current.padding : 0
|
2021-07-16 15:02:47 +00:00
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: mouseArea.containsMouse
|
|
|
|
color: Style.current.backgroundHover
|
|
|
|
}
|
2021-10-20 22:47:23 +00:00
|
|
|
|
|
|
|
StatusSmartIdenticon {
|
2020-08-03 17:17:03 +00:00
|
|
|
id: profileImage
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 4
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-10-20 22:47:23 +00:00
|
|
|
image.source: identicon
|
|
|
|
image.isIdenticon: true
|
2020-08-03 17:17:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: username
|
2021-10-21 00:41:54 +00:00
|
|
|
text: Utils.removeStatusEns(isCurrentUser ? root.store.profileModelInst.ens.preferredUsername || userName : userName)
|
2021-02-15 16:25:07 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 3
|
2020-08-03 17:17:03 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2021-02-15 16:25:07 +00:00
|
|
|
wrapMode: Text.Wrap
|
2020-08-03 17:17:03 +00:00
|
|
|
anchors.top: profileImage.bottom
|
|
|
|
anchors.topMargin: 4
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
2021-07-16 15:02:47 +00:00
|
|
|
id: mouseArea
|
2020-08-03 17:17:03 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
2021-07-16 15:02:47 +00:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
2020-08-03 17:17:03 +00:00
|
|
|
onClicked: {
|
2021-11-30 20:39:48 +00:00
|
|
|
root.openProfileClicked()
|
2021-10-21 00:41:54 +00:00
|
|
|
root.close()
|
2020-08-03 17:17:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
anchors.bottom: viewProfileAction.top
|
2021-10-21 00:41:54 +00:00
|
|
|
visible: !root.emojiOnly && !root.hideEmojiPicker
|
2020-08-03 17:17:03 +00:00
|
|
|
}
|
|
|
|
|
2021-08-06 15:44:57 +00:00
|
|
|
/* // copy link feature not ready yet
|
|
|
|
StatusMenuItem {
|
2021-02-23 10:18:09 +00:00
|
|
|
id: copyLinkAction
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Copy link"
|
|
|
|
text: qsTrId("copy-link")
|
2021-02-23 10:18:09 +00:00
|
|
|
onTriggered: {
|
2021-10-21 00:41:54 +00:00
|
|
|
root.store.chatsModelInst.copyToClipboard(linkUrls.split(" ")[0])
|
|
|
|
root.close()
|
2021-02-23 10:18:09 +00:00
|
|
|
}
|
2021-08-06 15:44:57 +00:00
|
|
|
icon.name: "link"
|
2021-02-23 10:18:09 +00:00
|
|
|
enabled: false
|
|
|
|
}
|
|
|
|
|
2021-10-14 11:48:03 +00:00
|
|
|
// TODO: replace with StatusPopupMenu
|
2021-02-23 10:18:09 +00:00
|
|
|
PopupMenu {
|
|
|
|
id: copyLinkMenu
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Copy link"
|
|
|
|
title: qsTrId("copy-link")
|
2021-04-07 17:36:30 +00:00
|
|
|
|
2021-02-23 10:18:09 +00:00
|
|
|
Repeater {
|
|
|
|
id: linksRepeater
|
2021-10-21 00:41:54 +00:00
|
|
|
model: root.linkUrls.split(" ")
|
2021-02-23 10:18:09 +00:00
|
|
|
delegate: MenuItem {
|
2021-04-07 17:36:30 +00:00
|
|
|
id: popupMenuItem
|
2021-02-23 10:18:09 +00:00
|
|
|
text: modelData
|
|
|
|
onTriggered: {
|
2021-10-21 00:41:54 +00:00
|
|
|
root.store.chatsModelInst.copyToClipboard(modelData)
|
|
|
|
root.close()
|
2021-02-23 10:18:09 +00:00
|
|
|
}
|
2021-04-07 17:36:30 +00:00
|
|
|
contentItem: StyledText {
|
|
|
|
text: popupMenuItem.text
|
|
|
|
font: popupMenuItem.font
|
|
|
|
color: Style.current.textColor
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
implicitWidth: 220
|
|
|
|
implicitHeight: 34
|
2021-04-09 13:46:37 +00:00
|
|
|
color: popupMenuItem.highlighted ? Style.current.backgroundHover: Style.current.transparent
|
2021-04-07 17:36:30 +00:00
|
|
|
}
|
2021-02-23 10:18:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-06 15:44:57 +00:00
|
|
|
*/
|
2021-02-23 10:18:09 +00:00
|
|
|
|
2021-08-16 09:11:43 +00:00
|
|
|
StatusMenuItem {
|
|
|
|
id: copyImageAction
|
|
|
|
text: qsTr("Copy image")
|
|
|
|
onTriggered: {
|
2021-10-21 00:41:54 +00:00
|
|
|
root.store.chatsModelInst.copyImageToClipboard(imageSource ? imageSource : "")
|
|
|
|
root.close()
|
2021-08-16 09:11:43 +00:00
|
|
|
}
|
|
|
|
icon.name: "copy"
|
|
|
|
enabled: isRightClickOnImage
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
id: downloadImageAction
|
|
|
|
text: qsTr("Download image")
|
|
|
|
onTriggered: {
|
|
|
|
fileDialog.open()
|
2021-10-21 00:41:54 +00:00
|
|
|
root.close()
|
2021-08-16 09:11:43 +00:00
|
|
|
}
|
|
|
|
icon.name: "download"
|
|
|
|
enabled: isRightClickOnImage
|
|
|
|
}
|
|
|
|
|
2021-08-06 15:44:57 +00:00
|
|
|
StatusMenuItem {
|
2020-08-03 17:17:03 +00:00
|
|
|
id: viewProfileAction
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "View Profile"
|
2020-08-03 17:17:03 +00:00
|
|
|
text: qsTrId("view-profile")
|
2020-09-17 14:26:26 +00:00
|
|
|
onTriggered: {
|
2021-11-30 20:39:48 +00:00
|
|
|
root.openProfileClicked()
|
2021-10-21 00:41:54 +00:00
|
|
|
root.close()
|
2020-09-17 14:26:26 +00:00
|
|
|
}
|
2021-08-06 15:44:57 +00:00
|
|
|
icon.name: "profile"
|
|
|
|
enabled: isProfile
|
2020-08-03 17:17:03 +00:00
|
|
|
}
|
2021-06-29 14:49:32 +00:00
|
|
|
|
2021-08-06 15:44:57 +00:00
|
|
|
StatusMenuItem {
|
|
|
|
id: sendMessageOrReplyTo
|
2021-10-21 00:41:54 +00:00
|
|
|
text: root.isProfile ?
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Send message"
|
|
|
|
qsTrId("send-message") :
|
2020-08-03 17:17:03 +00:00
|
|
|
//% "Reply to"
|
|
|
|
qsTrId("reply-to")
|
2020-09-17 14:26:26 +00:00
|
|
|
onTriggered: {
|
2021-10-21 00:41:54 +00:00
|
|
|
if (root.isProfile) {
|
2021-12-06 21:10:54 +00:00
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.chat)
|
2021-12-09 16:25:38 +00:00
|
|
|
chatSectionModule.createOneToOneChat(fromAuthor, "")
|
2020-12-10 11:41:28 +00:00
|
|
|
} else {
|
2021-07-22 07:47:15 +00:00
|
|
|
showReplyArea()
|
2020-12-10 11:41:28 +00:00
|
|
|
}
|
2021-10-21 00:41:54 +00:00
|
|
|
root.close()
|
2020-09-17 14:26:26 +00:00
|
|
|
}
|
2021-08-06 15:44:57 +00:00
|
|
|
icon.name: "chat"
|
2021-08-16 09:11:43 +00:00
|
|
|
enabled: isProfile || (!hideEmojiPicker && !emojiOnly && !isProfile && !isRightClickOnImage)
|
2020-08-03 17:17:03 +00:00
|
|
|
}
|
2021-07-22 07:47:15 +00:00
|
|
|
|
2021-08-06 15:44:57 +00:00
|
|
|
StatusMenuItem {
|
|
|
|
id: editMessageAction
|
|
|
|
//% "Edit message"
|
|
|
|
text: qsTrId("edit-message")
|
|
|
|
onTriggered: {
|
|
|
|
onClickEdit();
|
|
|
|
}
|
|
|
|
icon.name: "edit"
|
2021-08-16 09:11:43 +00:00
|
|
|
enabled: isCurrentUser && !hideEmojiPicker && !emojiOnly && !isProfile && !isRightClickOnImage
|
2021-07-16 15:06:52 +00:00
|
|
|
}
|
|
|
|
|
2021-11-11 16:22:03 +00:00
|
|
|
StatusMenuItem {
|
|
|
|
id: copyMessageIdAction
|
|
|
|
text: qsTr("Copy Message Id")
|
|
|
|
icon.name: "chat"
|
|
|
|
enabled: store.isDebugEnabled
|
|
|
|
onTriggered: {
|
|
|
|
root.store.chatsModelInst.copyToClipboard(SelectedMessage.messageId)
|
|
|
|
close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-06 15:44:57 +00:00
|
|
|
StatusMenuItem {
|
|
|
|
id: pinAction
|
|
|
|
text: {
|
|
|
|
if (pinnedMessage) {
|
|
|
|
//% "Unpin"
|
|
|
|
return qsTrId("unpin")
|
|
|
|
}
|
|
|
|
//% "Pin"
|
|
|
|
return qsTrId("pin")
|
|
|
|
|
|
|
|
}
|
2021-07-22 07:47:15 +00:00
|
|
|
onTriggered: {
|
2021-08-06 15:44:57 +00:00
|
|
|
if (pinnedMessage) {
|
2021-10-21 00:41:54 +00:00
|
|
|
root.store.chatsModelInst.messageView.unPinMessage(messageId, root.store.chatsModelInst.channelView.activeChannel.id)
|
2021-08-06 15:44:57 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!canPin) {
|
|
|
|
// Open pin modal so that the user can unpin one
|
2021-12-07 20:33:12 +00:00
|
|
|
Global.openPopup(pinnedMessagesPopupComponent, {messageToPin: messageId})
|
2021-08-06 15:44:57 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-10-21 00:41:54 +00:00
|
|
|
root.store.chatsModelInst.messageView.pinMessage(messageId, root.store.chatsModelInst.channelView.activeChannel.id)
|
|
|
|
root.close()
|
2021-07-22 07:47:15 +00:00
|
|
|
}
|
2021-08-06 15:44:57 +00:00
|
|
|
icon.name: "pin"
|
|
|
|
enabled: {
|
2021-08-16 09:11:43 +00:00
|
|
|
if(isProfile || emojiOnly || isRightClickOnImage)
|
2021-08-06 15:44:57 +00:00
|
|
|
return false
|
|
|
|
|
2021-10-21 00:41:54 +00:00
|
|
|
switch (root.store.chatsModelInst.channelView.activeChannel.chatType) {
|
2021-12-09 12:53:40 +00:00
|
|
|
case Constants.chatType.publicChat: return false
|
|
|
|
case Constants.chatType.profile: return false
|
|
|
|
case Constants.chatType.oneToOne: return true
|
|
|
|
case Constants.chatType.privateGroupChat: return root.store.chatsModelInst.channelView.activeChannel.isAdmin(userProfile.pubKey)
|
|
|
|
case Constants.chatType.communityChat: return root.store.chatsModelInst.communities.activeCommunity.admin
|
2021-08-06 15:44:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {
|
2021-08-18 12:37:13 +00:00
|
|
|
visible: deleteMessageAction.enabled && (viewProfileAction.visible
|
|
|
|
|| sendMessageOrReplyTo.visible || editMessageAction.visible || pinAction.visible)
|
2021-07-22 07:47:15 +00:00
|
|
|
}
|
2021-08-06 15:44:57 +00:00
|
|
|
|
|
|
|
StatusMenuItem {
|
2021-07-26 18:44:25 +00:00
|
|
|
id: deleteMessageAction
|
2021-08-16 09:11:43 +00:00
|
|
|
enabled: isCurrentUser && !isProfile && !emojiOnly && !pinnedPopup && !isRightClickOnImage &&
|
2021-12-09 12:53:40 +00:00
|
|
|
(contentType === Constants.messageContentType.messageType ||
|
|
|
|
contentType === Constants.messageContentType.stickerType ||
|
|
|
|
contentType === Constants.messageContentType.emojiType ||
|
|
|
|
contentType === Constants.messageContentType.imageType ||
|
|
|
|
contentType === Constants.messageContentType.audioType)
|
2021-07-30 16:02:22 +00:00
|
|
|
//% "Delete message"
|
|
|
|
text: qsTrId("delete-message")
|
2021-07-26 18:44:25 +00:00
|
|
|
onTriggered: {
|
2021-10-20 09:50:50 +00:00
|
|
|
if (!localAccountSensitiveSettings.showDeleteMessageWarning) {
|
2021-10-21 00:41:54 +00:00
|
|
|
return root.store.chatsModelInst.messageView.deleteMessage(messageId)
|
2021-07-26 18:44:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
let confirmationDialog = openPopup(genericConfirmationDialog, {
|
2021-07-30 16:02:22 +00:00
|
|
|
//% "Confirm deleting this message"
|
|
|
|
title: qsTrId("confirm-deleting-this-message"),
|
|
|
|
//% "Are you sure you want to delete this message? Be aware that other clients are not guaranteed to delete the message as well."
|
|
|
|
confirmationText: qsTrId("are-you-sure-you-want-to-delete-this-message--be-aware-that-other-clients-are-not-guaranteed-to-delete-the-message-as-well-"),
|
2021-07-26 18:44:25 +00:00
|
|
|
height: 260,
|
|
|
|
"checkbox.visible": true,
|
|
|
|
executeConfirm: function () {
|
|
|
|
if (confirmationDialog.checkbox.checked) {
|
2021-10-20 09:50:50 +00:00
|
|
|
localAccountSensitiveSettings.showDeleteMessageWarning = false
|
2021-07-26 18:44:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
confirmationDialog.close()
|
2021-10-21 00:41:54 +00:00
|
|
|
root.store.chatsModelInst.messageView.deleteMessage(messageId)
|
2021-07-26 18:44:25 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2021-08-06 15:44:57 +00:00
|
|
|
icon.name: "delete"
|
|
|
|
type: StatusMenuItem.Type.Danger
|
2021-07-26 18:44:25 +00:00
|
|
|
}
|
2021-08-16 12:35:24 +00:00
|
|
|
|
|
|
|
StatusMenuItem {
|
2021-10-21 00:41:54 +00:00
|
|
|
enabled: root.pinnedPopup
|
2021-08-16 12:35:24 +00:00
|
|
|
text: qsTr("Jump to")
|
|
|
|
onTriggered: {
|
2021-10-21 00:41:54 +00:00
|
|
|
positionAtMessage(root.messageId)
|
|
|
|
root.close()
|
|
|
|
root.shouldCloseParentPopup()
|
2021-08-16 12:35:24 +00:00
|
|
|
}
|
|
|
|
icon.name: "up"
|
|
|
|
}
|
2021-08-16 09:11:43 +00:00
|
|
|
|
|
|
|
FileDialog {
|
|
|
|
id: fileDialog
|
|
|
|
title: qsTr("Please choose a directory")
|
|
|
|
selectFolder: true
|
|
|
|
modality: Qt.NonModal
|
|
|
|
onAccepted: {
|
2021-10-21 00:41:54 +00:00
|
|
|
root.store.chatsModelInst.downloadImage(imageSource ? imageSource : "", fileDialog.fileUrls)
|
2021-08-16 09:11:43 +00:00
|
|
|
fileDialog.close()
|
|
|
|
}
|
|
|
|
onRejected: {
|
|
|
|
fileDialog.close()
|
|
|
|
}
|
|
|
|
}
|
2020-08-03 17:17:03 +00:00
|
|
|
}
|