2020-11-30 12:03:52 -05:00
|
|
|
import QtQuick 2.13
|
2021-10-26 16:21:08 +02:00
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
2021-10-28 23:23:30 +03:00
|
|
|
import utils 1.0
|
2021-10-28 00:27:49 +03:00
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
|
|
|
import shared.controls 1.0
|
2021-10-28 23:23:30 +03:00
|
|
|
import shared.panels.chat 1.0
|
|
|
|
import shared.views.chat 1.0
|
|
|
|
import shared.controls.chat 1.0
|
2021-09-28 18:04:06 +03:00
|
|
|
|
2021-10-21 03:41:54 +03:00
|
|
|
Column {
|
2021-07-16 18:02:47 +03:00
|
|
|
id: root
|
|
|
|
width: parent.width
|
|
|
|
anchors.right: !isCurrentUser ? undefined : parent.right
|
|
|
|
z: (typeof chatLogView === "undefined") ? 1 : (chatLogView.count - index)
|
2021-10-01 18:58:36 +03:00
|
|
|
|
2021-10-22 01:39:53 +03:00
|
|
|
property var rootStore
|
|
|
|
property var messageStore
|
|
|
|
property var chatsModel: !!root.rootStore ? root.rootStore.chatsModelInst : null
|
|
|
|
|
2021-10-01 18:58:36 +03:00
|
|
|
//////////////////////////////////////
|
|
|
|
//TODO REMOVE
|
2020-06-16 17:24:43 -04:00
|
|
|
property string fromAuthor: "0x0011223344556677889910"
|
2020-05-28 11:55:52 -04:00
|
|
|
property string userName: "Jotaro Kujo"
|
2020-12-08 16:45:43 +01:00
|
|
|
property string alias: ""
|
|
|
|
property string localName: ""
|
2020-05-28 11:55:52 -04:00
|
|
|
property string message: "That's right. We're friends... Of justice, that is."
|
2020-07-10 11:24:52 -04:00
|
|
|
property string plainText: "That's right. We're friends... Of justice, that is."
|
2020-07-20 13:04:33 -04:00
|
|
|
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQAQMAAAC6caSPAAAABlBMVEXMzMz////TjRV2AAAAAWJLR0QB/wIt3gAAACpJREFUGBntwYEAAAAAw6D7Uw/gCtUAAAAAAAAAAAAAAAAAAAAAAAAAgBNPsAABAjKCqQAAAABJRU5ErkJggg=="
|
2020-05-28 11:55:52 -04:00
|
|
|
property bool isCurrentUser: false
|
2020-06-11 13:50:36 -04:00
|
|
|
property string timestamp: "1234567"
|
2020-05-28 17:34:04 -04:00
|
|
|
property string sticker: "Qme8vJtyrEHxABcSVGPF95PtozDgUyfr1xGjePmFdZgk9v"
|
2021-07-07 11:58:59 -04:00
|
|
|
property int contentType: 1 // constants don't work in default props
|
2020-06-08 13:29:28 -04:00
|
|
|
property string chatId: "chatId"
|
2020-07-01 14:24:13 -04:00
|
|
|
property string outgoingStatus: ""
|
2020-07-09 11:50:38 -04:00
|
|
|
property string responseTo: ""
|
2020-07-09 13:47:36 -04:00
|
|
|
property string messageId: ""
|
2020-08-12 11:01:03 -04:00
|
|
|
property string emojiReactions: ""
|
2020-07-11 21:03:39 -04:00
|
|
|
property int prevMessageIndex: -1
|
2021-05-23 09:44:14 -04:00
|
|
|
property int nextMessageIndex: -1
|
2020-07-14 11:35:21 -04:00
|
|
|
property bool timeout: false
|
2021-02-01 13:40:55 -05:00
|
|
|
property bool hasMention: false
|
2020-11-25 11:43:36 +01:00
|
|
|
property string linkUrls: ""
|
2020-11-30 12:03:52 -05:00
|
|
|
property bool placeholderMessage: false
|
2021-06-11 13:41:59 -04:00
|
|
|
property bool activityCenterMessage: false
|
2021-05-25 15:34:46 -04:00
|
|
|
property bool pinnedMessage: false
|
2021-06-14 11:40:05 -04:00
|
|
|
property bool read: true
|
2021-05-25 15:38:18 -04:00
|
|
|
property string pinnedBy
|
2021-05-25 15:34:46 -04:00
|
|
|
property bool forceHoverHandler: false // Used to force the HoverHandler to be active (useful for messages in popups)
|
2020-12-11 15:38:10 -05:00
|
|
|
property string communityId: ""
|
2021-03-08 15:24:39 -04:00
|
|
|
property int stickerPackId: -1
|
2021-05-10 15:12:26 -04:00
|
|
|
property int gapFrom: 0
|
|
|
|
property int gapTo: 0
|
2021-06-29 10:49:32 -04:00
|
|
|
property bool isEdit: false
|
|
|
|
property string replaces: ""
|
|
|
|
property bool isEdited: false
|
2021-07-09 15:18:45 +01:00
|
|
|
property bool showEdit: true
|
2021-07-16 18:02:47 +03:00
|
|
|
property var messageContextMenu
|
2021-04-29 15:08:57 -04:00
|
|
|
property string displayUserName: {
|
|
|
|
if (isCurrentUser) {
|
|
|
|
//% "You"
|
|
|
|
return qsTrId("You")
|
|
|
|
}
|
|
|
|
|
|
|
|
if (localName !== "") {
|
|
|
|
return localName
|
|
|
|
}
|
|
|
|
|
|
|
|
if (userName !== "") {
|
|
|
|
return Utils.removeStatusEns(userName)
|
|
|
|
}
|
|
|
|
return Utils.removeStatusEns(alias)
|
|
|
|
}
|
|
|
|
|
2020-06-05 18:20:45 -04:00
|
|
|
property string authorCurrentMsg: "authorCurrentMsg"
|
|
|
|
property string authorPrevMsg: "authorPrevMsg"
|
2020-05-27 18:59:17 -04:00
|
|
|
|
2021-10-22 01:39:53 +03:00
|
|
|
property string prevMsgTimestamp: !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageData(prevMessageIndex, "timestamp") : ""
|
|
|
|
property string nextMsgTimestamp: !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageData(nextMessageIndex, "timestamp"): ""
|
2021-05-23 09:44:14 -04:00
|
|
|
|
2021-02-09 10:53:54 -04:00
|
|
|
property bool shouldRepeatHeader: ((parseInt(timestamp, 10) - parseInt(prevMsgTimestamp, 10)) / 60 / 1000) > Constants.repeatHeaderInterval
|
|
|
|
|
2020-06-24 15:58:17 -04:00
|
|
|
property bool isEmoji: contentType === Constants.emojiType
|
2020-07-17 15:44:25 -04:00
|
|
|
property bool isImage: contentType === Constants.imageType
|
2020-07-30 12:07:41 -04:00
|
|
|
property bool isAudio: contentType === Constants.audioType
|
2020-06-24 15:58:17 -04:00
|
|
|
property bool isStatusMessage: contentType === Constants.systemMessagePrivateGroupType
|
2020-07-09 13:29:19 -04:00
|
|
|
property bool isSticker: contentType === Constants.stickerType
|
2021-06-29 10:49:32 -04:00
|
|
|
property bool isText: contentType === Constants.messageType || contentType === Constants.editType
|
2021-02-01 13:40:55 -05:00
|
|
|
property bool isMessage: isEmoji || isImage || isSticker || isText || isAudio
|
|
|
|
|| contentType === Constants.communityInviteType || contentType === Constants.transactionType
|
2020-06-10 11:14:12 -04:00
|
|
|
|
2021-04-23 11:49:05 -04:00
|
|
|
property bool isExpired: (outgoingStatus === "sending" && (Math.floor(timestamp) + 180000) < Date.now())
|
2020-12-10 12:47:30 +01:00
|
|
|
property bool isStatusUpdate: false
|
2021-07-15 17:59:30 +03:00
|
|
|
property int statusAgeEpoch: 0
|
2020-07-16 13:27:09 -04:00
|
|
|
|
2021-10-22 01:39:53 +03:00
|
|
|
property int replyMessageIndex: !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageIndex(responseTo) : -1
|
|
|
|
property string repliedMessageAuthor: replyMessageIndex > -1 ? !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "userName") : "" : "";
|
|
|
|
property string repliedMessageAuthorPubkey: replyMessageIndex > -1 ? root.chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "publicKey") : "";
|
2021-10-29 20:06:18 +02:00
|
|
|
property bool repliedMessageAuthorIsCurrentUser: replyMessageIndex > -1 ? repliedMessageAuthorPubkey === userProfile.pubKey : "";
|
2021-10-22 01:39:53 +03:00
|
|
|
property bool repliedMessageIsEdited: replyMessageIndex > -1 ? !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "isEdited") === "true" : false : false;
|
|
|
|
property string repliedMessageContent: replyMessageIndex > -1 ? !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "message") : "" : "";
|
|
|
|
property int repliedMessageType: replyMessageIndex > -1 ? !!root.chatsModel ? parseInt(root.chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "contentType")) : 0 : 0;
|
|
|
|
property string repliedMessageImage: replyMessageIndex > -1 ? !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "image") : "" : "";
|
|
|
|
property string repliedMessageUserIdenticon: replyMessageIndex > -1 ? !!root.chatsModel ? root.chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "identicon") : "" : "";
|
2021-04-23 11:49:05 -04:00
|
|
|
property string repliedMessageUserImage: replyMessageIndex > -1 ? appMain.getProfileImage(repliedMessageAuthorPubkey, repliedMessageAuthorIsCurrentUser , false) || "" : "";
|
2020-07-09 11:50:38 -04:00
|
|
|
|
2020-09-12 20:22:07 +02:00
|
|
|
property var imageClick: function () {}
|
2020-07-10 11:37:23 -04:00
|
|
|
property var scrollToBottom: function () {}
|
2020-11-30 12:03:52 -05:00
|
|
|
property string userPubKey: {
|
|
|
|
if (contentType === Constants.chatIdentifier) {
|
|
|
|
return chatId
|
|
|
|
}
|
|
|
|
return fromAuthor
|
|
|
|
}
|
|
|
|
property bool useLargeImage: contentType === Constants.chatIdentifier
|
|
|
|
|
2020-12-21 13:08:44 +01:00
|
|
|
property string profileImageSource: !placeholderMessage && appMain.getProfileImage(userPubKey, isCurrentUser, useLargeImage) || ""
|
2020-11-30 12:03:52 -05:00
|
|
|
|
2021-02-01 15:37:50 -05:00
|
|
|
property var emojiReactionsModel: {
|
|
|
|
if (!emojiReactions) {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
// group by id
|
|
|
|
var allReactions = Object.values(JSON.parse(emojiReactions))
|
|
|
|
var byEmoji = {}
|
|
|
|
allReactions.forEach(function (reaction) {
|
|
|
|
if (!byEmoji[reaction.emojiId]) {
|
|
|
|
byEmoji[reaction.emojiId] = {
|
|
|
|
emojiId: reaction.emojiId,
|
|
|
|
fromAccounts: [],
|
|
|
|
count: 0,
|
|
|
|
currentUserReacted: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
byEmoji[reaction.emojiId].count++;
|
2021-10-22 01:39:53 +03:00
|
|
|
byEmoji[reaction.emojiId].fromAccounts.push(root.chatsModel.userNameOrAlias(reaction.from));
|
2021-10-29 20:06:18 +02:00
|
|
|
if (!byEmoji[reaction.emojiId].currentUserReacted && reaction.from === userProfile.pubKey) {
|
2021-02-01 15:37:50 -05:00
|
|
|
byEmoji[reaction.emojiId].currentUserReacted = true
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
return Object.values(byEmoji)
|
|
|
|
} catch (e) {
|
|
|
|
console.error('Error parsing emoji reactions', e)
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-16 11:11:43 +02:00
|
|
|
property var clickMessage: function(isProfileClick, isSticker = false, isImage = false, image = null, emojiOnly = false, hideEmojiPicker = false, isReply = false, isRightClickOnImage = false, imageSource = "") {
|
2021-06-11 13:41:59 -04:00
|
|
|
if (placeholderMessage || activityCenterMessage) {
|
2021-05-28 13:35:21 -04:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-08-03 13:17:03 -04:00
|
|
|
if (!isProfileClick) {
|
|
|
|
SelectedMessage.set(messageId, fromAuthor);
|
|
|
|
}
|
2021-03-08 15:24:39 -04:00
|
|
|
|
2021-07-28 11:52:25 +02:00
|
|
|
messageContextMenu.messageId = root.messageId
|
2021-07-20 11:26:41 -04:00
|
|
|
messageContextMenu.contentType = root.contentType
|
2021-07-28 11:52:25 +02:00
|
|
|
messageContextMenu.linkUrls = root.linkUrls;
|
2021-07-16 18:02:47 +03:00
|
|
|
messageContextMenu.isProfile = !!isProfileClick;
|
2021-07-26 14:44:25 -04:00
|
|
|
messageContextMenu.isCurrentUser = root.isCurrentUser
|
|
|
|
messageContextMenu.isText = root.isText
|
2021-07-16 18:02:47 +03:00
|
|
|
messageContextMenu.isSticker = isSticker;
|
|
|
|
messageContextMenu.emojiOnly = emojiOnly;
|
|
|
|
messageContextMenu.hideEmojiPicker = hideEmojiPicker;
|
|
|
|
messageContextMenu.pinnedMessage = pinnedMessage;
|
2021-07-22 13:08:37 -04:00
|
|
|
messageContextMenu.isCurrentUser = isCurrentUser;
|
2021-08-16 11:11:43 +02:00
|
|
|
messageContextMenu.isRightClickOnImage = isRightClickOnImage
|
|
|
|
messageContextMenu.imageSource = imageSource
|
2021-08-19 15:04:52 +02:00
|
|
|
messageContextMenu.onClickEdit = function() {root.isEdit = true}
|
2021-07-28 11:52:25 +02:00
|
|
|
|
|
|
|
if (isReply) {
|
|
|
|
let nickname = appMain.getUserNickname(repliedMessageAuthor)
|
|
|
|
messageContextMenu.show(repliedMessageAuthor, repliedMessageAuthorPubkey, repliedMessageUserImage || repliedMessageUserIdenticon, plainText, nickname, emojiReactionsModel);
|
|
|
|
} else {
|
|
|
|
let nickname = appMain.getUserNickname(fromAuthor)
|
|
|
|
messageContextMenu.show(userName, fromAuthor, root.profileImageSource || identicon, plainText, nickname, emojiReactionsModel);
|
|
|
|
}
|
|
|
|
|
2021-08-25 22:31:00 +02:00
|
|
|
messageContextMenu.x = messageContextMenu.setXPosition()
|
|
|
|
messageContextMenu.y = messageContextMenu.setYPosition()
|
2020-06-17 08:53:51 -04:00
|
|
|
}
|
|
|
|
|
2021-10-01 18:58:36 +03:00
|
|
|
|
|
|
|
function showReactionAuthors(fromAccounts, emojiId) {
|
2021-11-02 20:58:48 +01:00
|
|
|
return root.rootStore.showReactionAuthors(fromAccounts, emojiId)
|
2021-10-01 18:58:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function startMessageFoundAnimation() {
|
|
|
|
messageLoader.item.startMessageFoundAnimation();
|
|
|
|
}
|
|
|
|
/////////////////////////////////////////////
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
enabled: (!placeholderMessage && !!root.rootStore)
|
|
|
|
target: !!root.rootStore ? root.rootStore.profileModelInst.contacts.list : null
|
|
|
|
onContactChanged: {
|
|
|
|
if (pubkey === fromAuthor) {
|
|
|
|
const img = appMain.getProfileImage(userPubKey, isCurrentUser, useLargeImage)
|
|
|
|
if (img) {
|
|
|
|
profileImageSource = img
|
|
|
|
}
|
|
|
|
} else if (replyMessageIndex > -1 && pubkey === repliedMessageAuthorPubkey) {
|
|
|
|
const imgReply = appMain.getProfileImage(repliedMessageAuthorPubkey, repliedMessageAuthorIsCurrentUser, false)
|
|
|
|
if (imgReply) {
|
|
|
|
repliedMessageUserImage = imgReply
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
enabled: !!root.rootStore
|
2021-10-22 01:39:53 +03:00
|
|
|
target: !!root.rootStore ? root.chatsModel.messageView : null
|
2021-10-01 18:58:36 +03:00
|
|
|
onHideMessage: {
|
|
|
|
// This hack is used because message_list deleteMessage sometimes does not remove the messages (there might be an issue with the delegate model)
|
|
|
|
if(mId === messageId){
|
|
|
|
root.visible = 0;
|
|
|
|
root.height = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-15 17:04:14 -04:00
|
|
|
Loader {
|
2021-09-22 11:25:55 +03:00
|
|
|
id: messageLoader
|
2021-11-25 16:36:03 +01:00
|
|
|
active: root.visible
|
2020-07-15 17:04:14 -04:00
|
|
|
width: parent.width
|
|
|
|
sourceComponent: {
|
|
|
|
switch(contentType) {
|
|
|
|
case Constants.chatIdentifier:
|
|
|
|
return channelIdentifierComponent
|
2020-09-04 13:55:24 +02:00
|
|
|
case Constants.fetchMoreMessagesButton:
|
|
|
|
return fetchMoreMessagesButtonComponent
|
2020-07-15 17:04:14 -04:00
|
|
|
case Constants.systemMessagePrivateGroupType:
|
2020-07-22 08:23:15 -04:00
|
|
|
return privateGroupHeaderComponent
|
2021-05-10 15:12:26 -04:00
|
|
|
case Constants.gapType:
|
|
|
|
return gapComponent
|
2020-07-15 17:04:14 -04:00
|
|
|
default:
|
2021-01-25 15:13:43 -05:00
|
|
|
return isStatusUpdate ? statusUpdateComponent :
|
2021-10-20 11:50:50 +02:00
|
|
|
(localAccountSensitiveSettings.useCompactMode ? compactMessageComponent : messageComponent)
|
2021-01-25 15:13:43 -05:00
|
|
|
|
2020-06-04 12:30:49 +02:00
|
|
|
}
|
|
|
|
}
|
2020-05-27 18:59:17 -04:00
|
|
|
}
|
|
|
|
|
2021-05-10 15:12:26 -04:00
|
|
|
Component {
|
|
|
|
id: gapComponent
|
2021-10-21 03:41:54 +03:00
|
|
|
GapComponent {
|
|
|
|
onClicked: {
|
2021-10-22 01:39:53 +03:00
|
|
|
root.chatsModel.messageView.fillGaps(messageStore.messageId);
|
2021-10-21 03:41:54 +03:00
|
|
|
root.visible = false;
|
|
|
|
root.height = 0;
|
2021-05-10 15:12:26 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-04 13:55:24 +02:00
|
|
|
Component {
|
|
|
|
id: fetchMoreMessagesButtonComponent
|
2021-10-21 03:41:54 +03:00
|
|
|
FetchMoreMessagesButton {
|
|
|
|
// nextMessageIndex: root.messageStore.nextMessageIndex
|
|
|
|
// nextMsgTimestamp: root.messageStore.nextMsgTimestamp
|
|
|
|
onClicked: {
|
2021-10-22 01:39:53 +03:00
|
|
|
root.chatsModel.messageView.hideLoadingIndicator();
|
2020-09-04 13:55:24 +02:00
|
|
|
}
|
2021-10-21 03:41:54 +03:00
|
|
|
onTimerTriggered: {
|
2021-10-22 01:39:53 +03:00
|
|
|
root.chatsModel.requestMoreMessages(Constants.fetchRangeLast24Hours);
|
2020-09-04 13:55:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-15 17:04:14 -04:00
|
|
|
Component {
|
|
|
|
id: channelIdentifierComponent
|
2021-10-01 18:58:36 +03:00
|
|
|
ChannelIdentifierView {
|
2021-10-22 01:39:53 +03:00
|
|
|
store: root.rootStore
|
2020-11-30 12:03:52 -05:00
|
|
|
profileImage: profileImageSource
|
2021-10-22 01:39:53 +03:00
|
|
|
authorCurrentMsg: root.authorCurrentMsg
|
2020-06-10 14:23:18 -04:00
|
|
|
}
|
2020-05-27 18:59:17 -04:00
|
|
|
}
|
|
|
|
|
2020-07-15 17:04:14 -04:00
|
|
|
// Private group Messages
|
|
|
|
Component {
|
|
|
|
id: privateGroupHeaderComponent
|
|
|
|
StyledText {
|
2020-06-25 16:17:42 -04:00
|
|
|
wrapMode: Text.Wrap
|
2020-11-30 12:03:52 -05:00
|
|
|
text: {
|
2020-09-21 11:47:15 -04:00
|
|
|
return `<html>`+
|
|
|
|
`<head>`+
|
|
|
|
`<style type="text/css">`+
|
|
|
|
`a {`+
|
|
|
|
`color: ${Style.current.textColor};`+
|
|
|
|
`text-decoration: none;`+
|
|
|
|
`}`+
|
|
|
|
`</style>`+
|
|
|
|
`</head>`+
|
|
|
|
`<body>`+
|
|
|
|
`${message}`+
|
|
|
|
`</body>`+
|
|
|
|
`</html>`;
|
|
|
|
}
|
2020-07-15 17:04:14 -04:00
|
|
|
visible: isStatusMessage
|
2020-09-21 11:47:15 -04:00
|
|
|
font.pixelSize: 14
|
|
|
|
color: Style.current.secondaryText
|
2020-07-15 17:04:14 -04:00
|
|
|
width: parent.width - 120
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
textFormat: Text.RichText
|
2020-12-08 10:38:53 +11:00
|
|
|
topPadding: root.prevMessageIndex === 1 ? Style.current.bigPadding : 0
|
2020-07-09 13:47:36 -04:00
|
|
|
}
|
2020-07-09 11:50:38 -04:00
|
|
|
}
|
2020-05-28 15:32:14 -04:00
|
|
|
|
2020-07-15 17:04:14 -04:00
|
|
|
Component {
|
|
|
|
id: messageComponent
|
2021-10-01 18:58:36 +03:00
|
|
|
NormalMessageView {
|
2020-12-08 10:38:53 +11:00
|
|
|
linkUrls: root.linkUrls
|
|
|
|
isCurrentUser: root.isCurrentUser
|
2021-11-18 12:18:37 -04:00
|
|
|
isExpired: root.isExpired
|
|
|
|
timeout: root.timeout
|
2020-12-08 10:38:53 +11:00
|
|
|
contentType: root.contentType
|
2020-12-16 15:50:54 -05:00
|
|
|
container: root
|
2021-10-22 01:39:53 +03:00
|
|
|
store: root.rootStore
|
|
|
|
messageStore: root.messageStore
|
2020-05-28 15:32:14 -04:00
|
|
|
}
|
2020-07-09 11:50:38 -04:00
|
|
|
}
|
2020-07-10 11:37:23 -04:00
|
|
|
|
2020-12-10 12:47:30 +01:00
|
|
|
Component {
|
|
|
|
id: statusUpdateComponent
|
2021-10-22 01:39:53 +03:00
|
|
|
StatusUpdateView {
|
2021-07-15 17:59:30 +03:00
|
|
|
statusAgeEpoch: root.statusAgeEpoch
|
2020-12-16 15:50:54 -05:00
|
|
|
container: root
|
2021-10-22 01:39:53 +03:00
|
|
|
store: root.rootStore
|
2021-08-20 11:42:15 +02:00
|
|
|
messageContextMenu: root.messageContextMenu
|
|
|
|
onAddEmoji: {
|
|
|
|
root.clickMessage(isProfileClick, isSticker, isImage , image, emojiOnly, hideEmojiPicker);
|
|
|
|
}
|
2021-10-01 18:58:36 +03:00
|
|
|
onChatImageClicked: {
|
|
|
|
messageStore.imageClick(image);
|
|
|
|
}
|
|
|
|
onUserNameClicked: {
|
|
|
|
root.parent.clickMessage(isProfileClick);
|
|
|
|
}
|
|
|
|
onEmojiBtnClicked: {
|
|
|
|
root.parent.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly);
|
|
|
|
}
|
|
|
|
onClickMessage: {
|
|
|
|
root.parent.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly, hideEmojiPicker, isReply);
|
|
|
|
}
|
|
|
|
onSetMessageActive: {
|
|
|
|
root.messageStore.setMessageActive(messageId, active);;
|
|
|
|
}
|
2020-12-10 12:47:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-15 17:04:14 -04:00
|
|
|
Component {
|
|
|
|
id: compactMessageComponent
|
2021-10-01 18:58:36 +03:00
|
|
|
CompactMessageView {
|
2020-12-08 10:38:53 +11: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 11:53:44 +11:00
|
|
|
isCurrentUser: root.isCurrentUser
|
2021-11-18 12:18:37 -04:00
|
|
|
isExpired: root.isExpired
|
|
|
|
timeout: root.timeout
|
2020-12-08 10:38:53 +11:00
|
|
|
contentType: root.contentType
|
2021-07-09 15:18:45 +01:00
|
|
|
showEdit: root.showEdit
|
2020-12-16 15:50:54 -05:00
|
|
|
container: root
|
2021-07-16 18:02:47 +03:00
|
|
|
messageContextMenu: root.messageContextMenu
|
2021-10-22 01:39:53 +03:00
|
|
|
store: root.rootStore
|
2021-10-01 18:58:36 +03:00
|
|
|
messageStore: root.messageStore
|
2021-11-26 10:08:36 -05:00
|
|
|
repliedMessageUserIdenticon: root.repliedMessageUserIdenticon
|
|
|
|
repliedMessageUserImage: root.repliedMessageUserImage
|
2021-07-16 18:02:47 +03:00
|
|
|
onAddEmoji: {
|
|
|
|
root.clickMessage(isProfileClick, isSticker, isImage , image, emojiOnly, hideEmojiPicker);
|
|
|
|
}
|
2020-07-10 11:37:23 -04:00
|
|
|
}
|
2020-05-27 18:59:17 -04:00
|
|
|
}
|
|
|
|
}
|