diff --git a/src/app/chat/views/stickers.nim b/src/app/chat/views/stickers.nim index e946eaf96a..4f2c440e17 100644 --- a/src/app/chat/views/stickers.nim +++ b/src/app/chat/views/stickers.nim @@ -207,7 +207,7 @@ QtObject: self.recentStickers.addStickerToList(sticker) self.recentStickersUpdated() - proc send*(self: StickersView, hash: string, pack: int) {.slot.} = + proc send*(self: StickersView, hash: string, replyTo: string, pack: int) {.slot.} = let sticker = Sticker(hash: hash, packId: pack) self.addRecentStickerToList(sticker) - self.status.chat.sendSticker(self.activeChannel.id, sticker) + self.status.chat.sendSticker(self.activeChannel.id, replyTo, sticker) diff --git a/src/status/chat.nim b/src/status/chat.nim index 0b1e67a7bb..668c475e73 100644 --- a/src/status/chat.nim +++ b/src/status/chat.nim @@ -350,8 +350,8 @@ QtObject: var response = status_chat.deleteMessageAndSend(messageId) discard self.processMessageUpdateAfterSend(response, false) - proc sendSticker*(self: ChatModel, chatId: string, sticker: Sticker) = - var response = status_chat.sendStickerMessage(chatId, sticker) + proc sendSticker*(self: ChatModel, chatId: string, replyTo: string, sticker: Sticker) = + var response = status_chat.sendStickerMessage(chatId, replyTo, sticker) self.events.emit("stickerSent", StickerArgs(sticker: sticker, save: true)) var (chats, messages) = self.processChatUpdate(parseJson(response)) self.events.emit("chatUpdate", ChatUpdateArgs(messages: messages, chats: chats, contacts: @[])) @@ -773,4 +773,4 @@ QtObject: # notify view self.events.emit("messagesLoaded", MsgsLoadedArgs(chatId: chatId, messages: messages)) self.events.emit("reactionsLoaded", ReactionsLoadedArgs(reactions: reactions)) - self.events.emit("pinnedMessagesLoaded", MsgsLoadedArgs(chatId: chatId, messages: pinnedMessages)) \ No newline at end of file + self.events.emit("pinnedMessagesLoaded", MsgsLoadedArgs(chatId: chatId, messages: pinnedMessages)) diff --git a/src/status/libstatus/chat.nim b/src/status/libstatus/chat.nim index 31293d71ef..0fcea006c3 100644 --- a/src/status/libstatus/chat.nim +++ b/src/status/libstatus/chat.nim @@ -181,13 +181,13 @@ proc sendImageMessages*(chatId: string, images: var seq[string]): string = ) callPrivateRPC("sendChatMessages".prefix, %* [imagesJson]) -proc sendStickerMessage*(chatId: string, sticker: Sticker): string = +proc sendStickerMessage*(chatId: string, replyTo: string, sticker: Sticker): string = let preferredUsername = getSetting[string](Setting.PreferredUsername, "") callPrivateRPC("sendChatMessage".prefix, %* [ { "chatId": chatId, "text": "Update to latest version to see a nice sticker here!", - "responseTo": nil, + "responseTo": replyTo, "ensName": preferredUsername, "sticker": { "hash": sticker.hash, @@ -572,4 +572,4 @@ proc asyncSearchMessages*(chatId: string, searchTerm: string, caseSensitive: boo result = callPrivateRPC("allChatMessagesWhichMatchTerm".prefix, %* [chatId, searchTerm, caseSensitive]) except RpcException as e: success = false - result = e.msg \ No newline at end of file + result = e.msg diff --git a/ui/app/AppLayouts/Chat/ChatColumn.qml b/ui/app/AppLayouts/Chat/ChatColumn.qml index bf455e070e..dbed746536 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn.qml @@ -442,7 +442,7 @@ Item { txModalLoader.item.open() } onStickerSelected: { - chatsModel.stickers.send(hashId, packId) + chatsModel.stickers.send(hashId, chatInput.isReply ? SelectedMessage.messageId : "", packId) } onSendMessage: { if (chatInput.fileUrls.length > 0){ diff --git a/ui/shared/status/StatusChatInput.qml b/ui/shared/status/StatusChatInput.qml index 25ffd01b30..98fed97691 100644 --- a/ui/shared/status/StatusChatInput.qml +++ b/ui/shared/status/StatusChatInput.qml @@ -24,6 +24,7 @@ Rectangle { property bool paste: false; property bool isColonPressed: false; property bool isReply: false + property bool isImage: false property bool isEdit: false property bool isContactBlocked: false @@ -681,6 +682,7 @@ Rectangle { stickerPackList: control.stickerPackList onStickerSelected: { control.stickerSelected(hashId, packId) + control.hideExtendedArea(); messageInputField.forceActiveFocus(); } onClosed: {