2020-12-04 10:38:22 +00:00
|
|
|
import QtQuick 2.13
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../shared/status"
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-07-15 21:04:14 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../panels"
|
|
|
|
import "../views"
|
|
|
|
import "../controls"
|
2020-07-15 21:04:14 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
Item {
|
2020-12-07 23:38:53 +00:00
|
|
|
id: root
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.top: parent.top
|
2020-11-18 18:55:57 +00:00
|
|
|
anchors.topMargin: authorCurrentMsg !== authorPrevMsg ? Style.current.smallPadding : 0
|
2020-07-23 16:11:48 +00:00
|
|
|
height: childrenRect.height + this.anchors.topMargin + (dateGroupLbl.visible ? dateGroupLbl.height : 0)
|
2020-07-15 21:04:14 +00:00
|
|
|
width: parent.width
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
property var store
|
|
|
|
property var messageStore
|
|
|
|
property string linkUrls: ""
|
|
|
|
property bool isCurrentUser: false
|
|
|
|
property int contentType: 2
|
|
|
|
property var container
|
|
|
|
property bool headerRepeatCondition: (authorCurrentMsg !== authorPrevMsg
|
|
|
|
|| shouldRepeatHeader || dateGroupLbl.visible)
|
|
|
|
|
2020-07-15 21:04:14 +00:00
|
|
|
DateGroup {
|
|
|
|
id: dateGroupLbl
|
2021-06-11 17:41:59 +00:00
|
|
|
previousMessageIndex: prevMessageIndex
|
|
|
|
previousMessageTimestamp: prevMsgTimestamp
|
|
|
|
messageTimestamp: timestamp
|
2021-06-15 19:34:36 +00:00
|
|
|
isActivityCenterMessage: activityCenterMessage
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UserImage {
|
|
|
|
id: chatImage
|
2021-10-01 15:58:36 +00:00
|
|
|
active: root.store.chatsModelInst.channelView.activeChannel.chatType !== Constants.chatTypeOneToOne && isMessage && headerRepeatCondition && !root.isCurrentUser
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.top: dateGroupLbl.visible ? dateGroupLbl.bottom : parent.top
|
|
|
|
anchors.topMargin: 20
|
2021-10-01 15:58:36 +00:00
|
|
|
// isCurrentUser: root.messageStore.isCurrentUser
|
|
|
|
// profileImage: root.messageStore.profileImageSource
|
|
|
|
// isMessage: root.messageStore.isMessage
|
|
|
|
// identiconImageSource: root.messageStore.identicon
|
|
|
|
onClickMessage: {
|
|
|
|
root.parent.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly, hideEmojiPicker, isReply);
|
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UsernameLabel {
|
|
|
|
id: chatName
|
2021-10-01 15:58:36 +00:00
|
|
|
visible: root.store.chatsModelInst.channelView.activeChannel.chatType !== Constants.chatTypeOneToOne && isMessage && headerRepeatCondition && !root.isCurrentUser
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.leftMargin: 20
|
|
|
|
anchors.top: dateGroupLbl.visible ? dateGroupLbl.bottom : parent.top
|
|
|
|
anchors.topMargin: 0
|
|
|
|
anchors.left: chatImage.right
|
2021-10-01 15:58:36 +00:00
|
|
|
// isCurrentUser: root.messageStore.isCurrentUser
|
|
|
|
// userName: root.messageStore.userName
|
|
|
|
// localName: root.messageStore.localName
|
|
|
|
// displayUserName: root.messageStore.displayUserName
|
|
|
|
onClickMessage: {
|
|
|
|
root.parent.clickMessage(true, false, false, null, false, false, false);
|
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
2020-11-18 18:55:57 +00:00
|
|
|
readonly property int defaultMessageWidth: 400
|
|
|
|
readonly property int defaultMaxMessageChars: 54
|
2020-11-20 15:28:32 +00:00
|
|
|
readonly property int messageWidth: Math.max(defaultMessageWidth, parent.width / 1.4)
|
2020-11-18 18:55:57 +00:00
|
|
|
readonly property int maxMessageChars: (defaultMaxMessageChars * messageWidth) / defaultMessageWidth
|
2020-11-17 03:07:01 +00:00
|
|
|
property int chatVerticalPadding: isImage ? 4 : 6
|
2020-11-12 14:08:40 +00:00
|
|
|
property int chatHorizontalPadding: isImage ? 0 : 12
|
2021-02-08 18:46:20 +00:00
|
|
|
property bool longReply: chatReply.active && repliedMessageContent.length > maxMessageChars
|
2021-10-01 15:58:36 +00:00
|
|
|
property bool longChatText: root.store.chatsModelInst.plainText(root.messageStore.message).split('\n').some(function (messagePart) {
|
2020-11-18 18:55:57 +00:00
|
|
|
return messagePart.length > maxMessageChars
|
|
|
|
})
|
2020-07-15 21:04:14 +00:00
|
|
|
|
|
|
|
id: chatBox
|
2020-11-12 14:08:40 +00:00
|
|
|
color: {
|
|
|
|
if (isSticker) {
|
|
|
|
return Style.current.background
|
|
|
|
}
|
|
|
|
if (isImage) {
|
|
|
|
return "transparent"
|
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
return isCurrentUser ? Style.current.primary : Style.current.secondaryBackground
|
2020-11-12 14:08:40 +00:00
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
border.color: isSticker ? Style.current.border : Style.current.transparent
|
|
|
|
border.width: 1
|
2020-07-17 19:44:25 +00:00
|
|
|
height: {
|
|
|
|
let h = (3 * chatVerticalPadding)
|
|
|
|
switch(contentType){
|
|
|
|
case Constants.stickerType:
|
|
|
|
h += stickerId.height;
|
|
|
|
break;
|
2020-07-30 16:07:41 +00:00
|
|
|
case Constants.audioType:
|
|
|
|
h += audioPlayerLoader.height;
|
|
|
|
break;
|
2020-07-17 19:44:25 +00:00
|
|
|
default:
|
2020-10-06 15:07:12 +00:00
|
|
|
if (!chatImageContent.active && !chatReply.active) {
|
|
|
|
h -= chatVerticalPadding
|
|
|
|
}
|
|
|
|
|
2020-07-17 19:44:25 +00:00
|
|
|
h += chatText.visible ? chatText.height : 0;
|
2020-10-06 15:07:12 +00:00
|
|
|
h += chatImageContent.active ? chatImageContent.height: 0;
|
|
|
|
h += chatReply.active ? chatReply.height : 0;
|
2020-07-17 19:44:25 +00:00
|
|
|
}
|
|
|
|
return h;
|
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
width: {
|
2020-09-30 20:40:54 +00:00
|
|
|
switch(contentType) {
|
2020-07-15 21:04:14 +00:00
|
|
|
case Constants.stickerType:
|
|
|
|
return stickerId.width + (2 * chatBox.chatHorizontalPadding);
|
2020-07-17 19:44:25 +00:00
|
|
|
case Constants.imageType:
|
|
|
|
return chatImageContent.width
|
2020-07-15 21:04:14 +00:00
|
|
|
default:
|
2020-07-20 21:26:29 +00:00
|
|
|
if (longChatText || longReply) {
|
2020-11-18 18:55:57 +00:00
|
|
|
return messageWidth;
|
2020-07-20 21:26:29 +00:00
|
|
|
}
|
|
|
|
let baseWidth = chatText.width;
|
2020-09-30 20:40:54 +00:00
|
|
|
if (chatReply.visible && chatText.width < chatReply.textFieldWidth) {
|
|
|
|
baseWidth = chatReply.textFieldWidth
|
2020-07-20 21:26:29 +00:00
|
|
|
}
|
2020-12-10 20:59:00 +00:00
|
|
|
|
|
|
|
if (chatReply.visible && chatText.width < chatReply.authorWidth) {
|
|
|
|
if(chatReply.authorWidth > baseWidth){
|
|
|
|
baseWidth = chatReply.authorWidth + 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-20 21:26:29 +00:00
|
|
|
return baseWidth + 2 * chatHorizontalPadding
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
radius: 16
|
2020-12-07 23:38:53 +00:00
|
|
|
anchors.left: !root.isCurrentUser ? chatImage.right : undefined
|
|
|
|
anchors.leftMargin: !root.isCurrentUser ? 8 : 0
|
|
|
|
anchors.right: !root.isCurrentUser ? undefined : parent.right
|
|
|
|
anchors.rightMargin: !root.isCurrentUser ? 0 : Style.current.padding
|
2021-02-09 14:53:54 +00:00
|
|
|
anchors.top: headerRepeatCondition && !root.isCurrentUser ? chatImage.top : (dateGroupLbl.visible ? dateGroupLbl.bottom : parent.top)
|
2020-08-14 12:08:09 +00:00
|
|
|
anchors.topMargin: 0
|
2021-02-01 18:40:55 +00:00
|
|
|
visible: isMessage && contentType !== Constants.transactionType
|
2020-07-15 21:04:14 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
ChatReplyPanel {
|
2020-07-15 21:04:14 +00:00
|
|
|
id: chatReply
|
2020-07-20 21:26:29 +00:00
|
|
|
longReply: chatBox.longReply
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: chatReply.visible ? chatBox.chatVerticalPadding : 0
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: chatBox.chatHorizontalPadding
|
2020-12-16 20:50:54 +00:00
|
|
|
container: root.container
|
2021-02-08 18:46:20 +00:00
|
|
|
chatHorizontalPadding: chatBox.chatHorizontalPadding
|
2021-10-01 15:58:36 +00:00
|
|
|
stickerData: chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "sticker")
|
|
|
|
active: responseTo !== "" && replyMessageIndex > -1 && !activityCenterMessage
|
|
|
|
// To-Do move to store later?
|
|
|
|
// isCurrentUser: root.messageStore.isCurrentUser
|
|
|
|
// repliedMessageType: root.messageStore.repliedMessageType
|
|
|
|
// repliedMessageImage: root.messageStore.repliedMessageImage
|
|
|
|
// repliedMessageUserIdenticon: root.messageStore.repliedMessageUserIdenticon
|
|
|
|
// repliedMessageIsEdited: root.messageStore.repliedMessageIsEdited
|
|
|
|
// repliedMessageUserImage: root.messageStore.repliedMessageUserImage
|
|
|
|
// repliedMessageAuthor: root.messageStore.repliedMessageAuthor
|
|
|
|
// repliedMessageContent: root.messageStore.repliedMessageContent
|
|
|
|
// responseTo: root.messageStore.responseTo
|
|
|
|
// onScrollToBottom: {
|
|
|
|
// root.messageStore.scrollToBottom(isit, container);
|
|
|
|
// }
|
|
|
|
onClickMessage: {
|
|
|
|
root.parent.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly, hideEmojiPicker, isReply);
|
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: chatsModel.messageView
|
|
|
|
onMessageEdited: {
|
|
|
|
if(chatReply.item)
|
|
|
|
chatReply.item.messageEdited(editedMessageId, editedMessageContent)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ChatTextView {
|
2020-07-15 21:04:14 +00:00
|
|
|
id: chatText
|
2020-09-25 19:44:40 +00:00
|
|
|
longChatText: chatBox.longChatText
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.top: chatReply.bottom
|
2020-10-06 15:07:12 +00:00
|
|
|
anchors.topMargin: chatReply.active ? chatBox.chatVerticalPadding : 0
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-20 21:26:29 +00:00
|
|
|
anchors.leftMargin: chatBox.chatHorizontalPadding
|
|
|
|
anchors.right: chatBox.longChatText ? parent.right : undefined
|
|
|
|
anchors.rightMargin: chatBox.longChatText ? chatBox.chatHorizontalPadding : 0
|
2021-10-01 15:58:36 +00:00
|
|
|
messageStore: root.store.messageStore
|
2020-12-07 23:38:53 +00:00
|
|
|
textField.color: !root.isCurrentUser ? Style.current.textColor : Style.current.currentUserTextColor
|
2020-12-04 10:38:22 +00:00
|
|
|
Connections {
|
2021-02-10 20:41:00 +00:00
|
|
|
target: appSettings.useCompactMode ? null : chatBox
|
2020-12-04 10:38:22 +00:00
|
|
|
onLongChatTextChanged: {
|
|
|
|
chatText.setWidths()
|
|
|
|
}
|
|
|
|
}
|
2021-09-27 12:08:55 +00:00
|
|
|
|
|
|
|
onLinkActivated: {
|
2021-10-01 15:58:36 +00:00
|
|
|
if (root.messageStore.activityCenterMessage) {
|
|
|
|
clickMessage(false, root.messageStore.isSticker, false)
|
2021-09-27 12:08:55 +00:00
|
|
|
}
|
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
2020-07-20 17:34:20 +00:00
|
|
|
Loader {
|
2020-07-17 19:44:25 +00:00
|
|
|
id: chatImageContent
|
2021-10-01 15:58:36 +00:00
|
|
|
active: root.messageStore.isImage && !!image
|
2020-09-30 20:40:54 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: chatBox.chatHorizontalPadding
|
2020-11-27 15:38:58 +00:00
|
|
|
z: 51
|
2020-07-17 19:44:25 +00:00
|
|
|
|
2020-09-30 20:40:54 +00:00
|
|
|
sourceComponent: Component {
|
|
|
|
Item {
|
|
|
|
width: chatImageComponent.width + 2 * chatBox.chatHorizontalPadding
|
|
|
|
height: chatImageComponent.height
|
2020-11-27 15:38:58 +00:00
|
|
|
|
2021-08-30 12:42:11 +00:00
|
|
|
StatusChatImage {
|
2020-09-30 20:40:54 +00:00
|
|
|
id: chatImageComponent
|
|
|
|
imageSource: image
|
|
|
|
imageWidth: 250
|
2020-12-07 23:38:53 +00:00
|
|
|
isCurrentUser: root.isCurrentUser
|
2021-08-25 20:31:00 +00:00
|
|
|
onClicked: imageClick(image)
|
2020-12-16 20:50:54 +00:00
|
|
|
container: root.container
|
2020-09-30 20:40:54 +00:00
|
|
|
}
|
|
|
|
}
|
2020-07-20 17:34:20 +00:00
|
|
|
}
|
|
|
|
}
|
2020-07-30 16:07:41 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: audioPlayerLoader
|
2021-10-01 15:58:36 +00:00
|
|
|
active: root.messageStore.isAudio
|
2020-07-30 16:07:41 +00:00
|
|
|
sourceComponent: audioPlayer
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: audioPlayer
|
2021-10-01 15:58:36 +00:00
|
|
|
AudioPlayerPanel {
|
2020-07-30 16:07:41 +00:00
|
|
|
audioSource: audio
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-30 12:42:11 +00:00
|
|
|
StatusSticker {
|
2020-07-15 21:04:14 +00:00
|
|
|
id: stickerId
|
|
|
|
anchors.left: parent.left
|
2020-07-20 21:26:29 +00:00
|
|
|
anchors.leftMargin: chatBox.chatHorizontalPadding
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: chatBox.chatVerticalPadding
|
2020-09-23 08:18:23 +00:00
|
|
|
color: Style.current.transparent
|
2020-12-07 23:38:53 +00:00
|
|
|
contentType: root.contentType
|
2021-10-01 15:58:36 +00:00
|
|
|
stickerData: root.messageStore.sticker
|
2021-08-30 12:42:11 +00:00
|
|
|
onLoaded: {
|
2021-10-01 15:58:36 +00:00
|
|
|
root.messageStore.scrollToBottom(true, root.container)
|
2021-08-30 12:42:11 +00:00
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MessageMouseArea {
|
|
|
|
anchors.fill: parent
|
2021-09-27 12:08:55 +00:00
|
|
|
enabled: !chatText.linkHovered
|
2021-10-01 15:58:36 +00:00
|
|
|
isActivityCenterMessage: root.messageStore.activityCenterMessage
|
|
|
|
onClickMessage: {
|
|
|
|
root.parent.clickMessage(isProfileClick, root.messageStore.isSticker, root.messageStore.isImage)
|
|
|
|
}
|
|
|
|
onSetMessageActive: {
|
|
|
|
root.messageStore.setMessageActive(root.messageStore.messageId, active);
|
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
2020-07-16 14:51:12 +00:00
|
|
|
|
|
|
|
RectangleCorner {
|
|
|
|
// TODO find a way to show the corner for stickers since they have a border
|
2021-10-01 15:58:36 +00:00
|
|
|
visible: root.messageStore.isMessage
|
|
|
|
isCurrentUser: root.isCurrentUser
|
2020-07-16 14:51:12 +00:00
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
2021-02-01 18:40:55 +00:00
|
|
|
Loader {
|
|
|
|
id: transactionBubbleLoader
|
|
|
|
active: contentType === Constants.transactionType
|
|
|
|
anchors.left: !isCurrentUser ? chatImage.right : undefined
|
|
|
|
anchors.leftMargin: isCurrentUser ? 0 : Style.current.halfPadding
|
|
|
|
anchors.right: isCurrentUser ? parent.right : undefined
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
sourceComponent: Component {
|
2021-10-01 15:58:36 +00:00
|
|
|
TransactionBubblePanel {
|
2021-10-21 00:41:54 +00:00
|
|
|
balanceView: root.store.walletModelInst.balanceView
|
2021-10-01 15:58:36 +00:00
|
|
|
focusedAccount: root.store.walletModelInst.accountsView.focusedAccount
|
|
|
|
activeChannelName: root.store.chatsModelInst.channelView.activeChannel.name
|
|
|
|
activeChannelIdenticon: root.store.chatsModelInst.channelView.activeChannel.identicon
|
|
|
|
onGetGasPrice: {
|
|
|
|
root.store.walletModelInst.gasView.getGasPrice();
|
|
|
|
}
|
|
|
|
onSendTransactionClicked: {
|
|
|
|
root.store.walletModelInst.accountsView.setFocusedAccountByAddress(fromAddress);
|
|
|
|
}
|
|
|
|
}
|
2021-02-01 18:40:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-14 18:51:27 +00:00
|
|
|
Rectangle {
|
|
|
|
id: dateTimeBackground
|
|
|
|
visible: isImage
|
|
|
|
height: visible ? chatTime.height + Style.current.halfPadding : 0
|
|
|
|
width: chatTime.width + 2 * chatTime.anchors.rightMargin +
|
|
|
|
(retry.visible ? retry.width + retry.anchors.rightMargin : sentMessage.width + sentMessage.anchors.rightMargin)
|
|
|
|
color: Utils.setColorAlpha(Style.current.black, 0.66)
|
|
|
|
radius: Style.current.radius
|
|
|
|
anchors.bottom: chatBox.bottom
|
|
|
|
anchors.bottomMargin: Style.current.halfPadding
|
|
|
|
anchors.right: chatBox.right
|
|
|
|
anchors.rightMargin: 6
|
|
|
|
}
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
ChatTimeView {
|
2020-07-15 21:04:14 +00:00
|
|
|
id: chatTime
|
2021-10-01 15:58:36 +00:00
|
|
|
visible: root.messageStore.isMessage && !emojiReactionLoader.active
|
2021-01-14 18:51:27 +00:00
|
|
|
anchors.top: isImage ? undefined : (linksLoader.active ? linksLoader.bottom : chatBox.bottom)
|
|
|
|
anchors.topMargin: isImage ? 0 : 4
|
|
|
|
anchors.verticalCenter: isImage ? dateTimeBackground.verticalCenter : undefined
|
|
|
|
anchors.right: isImage ? dateTimeBackground.right : (linksLoader.active ? linksLoader.right : chatBox.right)
|
|
|
|
anchors.rightMargin: isImage ? 6 : (root.isCurrentUser ? 5 : Style.current.padding)
|
2021-10-21 00:41:54 +00:00
|
|
|
//timestamp: root.messageStore.timestamp
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SentMessage {
|
|
|
|
id: sentMessage
|
2021-10-01 15:58:36 +00:00
|
|
|
visible: root.isCurrentUser && !root.messageStore.timeout && !root.messageStore.isExpired
|
|
|
|
&& root.messageStore.isMessage && root.messageStore.outgoingStatus === "sent"
|
2021-01-14 18:51:27 +00:00
|
|
|
anchors.verticalCenter: chatTime.verticalCenter
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.right: chatTime.left
|
|
|
|
anchors.rightMargin: 5
|
|
|
|
}
|
2020-07-14 15:35:21 +00:00
|
|
|
|
|
|
|
Retry {
|
|
|
|
id: retry
|
2021-01-14 18:51:27 +00:00
|
|
|
anchors.verticalCenter: chatTime.verticalCenter
|
2020-07-14 15:35:21 +00:00
|
|
|
anchors.right: chatTime.left
|
|
|
|
anchors.rightMargin: 5
|
2021-10-01 15:58:36 +00:00
|
|
|
isCurrentUser: root.isCurrentUser
|
|
|
|
onClicked: {
|
|
|
|
root.store.chatsModelInst.messageView.resendMessage(chatId, messageId)
|
|
|
|
}
|
2020-07-14 15:35:21 +00:00
|
|
|
}
|
|
|
|
|
2020-10-23 19:46:44 +00:00
|
|
|
Loader {
|
|
|
|
id: linksLoader
|
2020-12-07 23:38:53 +00:00
|
|
|
active: !!root.linkUrls
|
|
|
|
anchors.left: !root.isCurrentUser ? chatImage.right : undefined
|
|
|
|
anchors.leftMargin: !root.isCurrentUser ? 8 : 0
|
|
|
|
anchors.right: !root.isCurrentUser ? undefined : parent.right
|
|
|
|
anchors.rightMargin: !root.isCurrentUser ? 0 : Style.current.padding
|
2020-10-23 19:46:44 +00:00
|
|
|
anchors.top: chatBox.bottom
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.bottomMargin: Style.current.halfPadding
|
2020-10-23 19:46:44 +00:00
|
|
|
|
|
|
|
sourceComponent: Component {
|
2021-10-01 15:58:36 +00:00
|
|
|
LinksMessageView {
|
2020-12-07 23:38:53 +00:00
|
|
|
linkUrls: root.linkUrls
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
container: root.container
|
|
|
|
isCurrentUser: root.isCurrentUser
|
2020-12-07 23:38:53 +00:00
|
|
|
}
|
2020-10-23 19:46:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-12 15:01:03 +00:00
|
|
|
Loader {
|
|
|
|
id: emojiReactionLoader
|
|
|
|
active: emojiReactions !== ""
|
|
|
|
sourceComponent: emojiReactionsComponent
|
2021-02-08 18:46:20 +00:00
|
|
|
anchors.left: root.isCurrentUser ? undefined : chatBox.left
|
|
|
|
anchors.right: root.isCurrentUser ? chatBox.right : undefined
|
2021-02-01 18:40:55 +00:00
|
|
|
anchors.leftMargin: root.isCurrentUser ? Style.current.halfPadding : 1
|
2020-08-12 15:01:03 +00:00
|
|
|
anchors.top: chatBox.bottom
|
|
|
|
anchors.topMargin: 2
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: emojiReactionsComponent
|
2021-10-01 15:58:36 +00:00
|
|
|
EmojiReactionsPanel {
|
|
|
|
// isMessageActive: root.store.messageStore.isMessageActive
|
|
|
|
// emojiReactionsModel: root.store.messageStore.emojiReactionsModel
|
|
|
|
onSetMessageActive: {
|
|
|
|
root.store.messageStore.setMessageActive(messageId, active);;
|
|
|
|
}
|
|
|
|
onToggleReaction: chatsModel.toggleReaction(messageId, emojiID)
|
|
|
|
}
|
2020-08-12 15:01:03 +00:00
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|