fix(edit): fix edit message not sending mentions correctly

Fixes #10074
This commit is contained in:
Jonathan Rainville 2023-03-29 14:50:00 -04:00
parent 14c264e350
commit 0424715810
2 changed files with 11 additions and 7 deletions

View File

@ -59,7 +59,15 @@ Item {
size: StatusBaseButton.Size.Small size: StatusBaseButton.Size.Small
enabled: !!chatInputLoader.item && chatInputLoader.item.messageText.trim().length > 0 enabled: !!chatInputLoader.item && chatInputLoader.item.messageText.trim().length > 0
onClicked: { onClicked: {
editCompleted(!chatInputLoader.item ? "" : chatInputLoader.item.messageText) let text = ""
if (chatInputLoader.item) {
if (chatInputLoader.item.getTextWithPublicKeys) {
text = chatInputLoader.item.getTextWithPublicKeys()
} else {
text = chatInputLoader.item.messageText
}
}
editCompleted(text)
} }
} }
} }

View File

@ -479,9 +479,7 @@ Loader {
delegate.editCancelledHandler() delegate.editCancelledHandler()
} }
onEditCompleted: { onEditCompleted: delegate.editCompletedHandler(newMsgText)
delegate.editCompletedHandler(newMsgText)
}
onImageClicked: { onImageClicked: {
switch (mouse.button) { switch (mouse.button) {
@ -679,9 +677,7 @@ Loader {
chatType: root.messageStore.chatType chatType: root.messageStore.chatType
isEdit: true isEdit: true
onSendMessage: { onSendMessage: delegate.editCompletedHandler(editTextInput.getTextWithPublicKeys())
delegate.editCompletedHandler(editTextInput.textInput.text)
}
Component.onCompleted: { Component.onCompleted: {
parseMessage(root.messageText); parseMessage(root.messageText);