From 3994f8b2fbb14e84dc05abfa5e6c7df817bf378f Mon Sep 17 00:00:00 2001 From: mprakhov Date: Mon, 9 Jan 2023 23:13:08 +0200 Subject: [PATCH] fix(@desktop/chat): show message which was sent during group chat creation --- ui/app/AppLayouts/Chat/stores/RootStore.qml | 5 +++-- ui/app/AppLayouts/Chat/views/ChatColumnView.qml | 3 ++- ui/app/AppLayouts/Chat/views/ChatContentView.qml | 3 ++- ui/app/AppLayouts/Chat/views/CreateChatView.qml | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index b7845eeac28..6f06efc874b 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -100,8 +100,9 @@ QtObject { return msg } - function sendMessage(event, text, replyMessageId, fileUrlsAndSources) { - var chatContentModule = currentChatContentModule() + function sendMessage(chatId, event, text, replyMessageId, fileUrlsAndSources) { + chatCommunitySectionModule.prepareChatContentModuleForChatId(chatId) + const chatContentModule = chatCommunitySectionModule.getChatContentModule() if (fileUrlsAndSources.length > 0){ chatContentModule.inputAreaModule.sendImages(JSON.stringify(fileUrlsAndSources)); } diff --git a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml index 22d57d81bb0..c1d04ca9588 100644 --- a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml @@ -90,7 +90,8 @@ Item { else if (root.rootStore.createChatInitMessage !== "" || root.rootStore.createChatFileUrls.length > 0) { - root.rootStore.sendMessage(Qt.Key_Enter, + root.rootStore.sendMessage(chatId, + Qt.Key_Enter, root.rootStore.createChatInitMessage, "", root.rootStore.createChatFileUrls diff --git a/ui/app/AppLayouts/Chat/views/ChatContentView.qml b/ui/app/AppLayouts/Chat/views/ChatContentView.qml index 0812d78119c..0fbcf8b24f4 100644 --- a/ui/app/AppLayouts/Chat/views/ChatContentView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatContentView.qml @@ -236,7 +236,8 @@ ColumnLayout { return } - if(root.rootStore.sendMessage(event, + if(root.rootStore.sendMessage(chatContentModule.getMyChatId(), + event, chatInput.getTextWithPublicKeys(), chatInput.isReply? chatInput.replyMessageId : "", chatInput.fileUrlsAndSources diff --git a/ui/app/AppLayouts/Chat/views/CreateChatView.qml b/ui/app/AppLayouts/Chat/views/CreateChatView.qml index 0887fb01cfb..ec2b3b8503f 100644 --- a/ui/app/AppLayouts/Chat/views/CreateChatView.qml +++ b/ui/app/AppLayouts/Chat/views/CreateChatView.qml @@ -25,7 +25,7 @@ Page { function createChat() { root.rootStore.createChatInitMessage = chatInput.textInput.text - root.rootStore.createChatFileUrls = chatInput.fileUrls + root.rootStore.createChatFileUrls = chatInput.fileUrlsAndSources membersSelector.createChat() membersSelector.cleanup()