diff options
author | link2xt <link2xt@testrun.org> | 2021-05-31 09:49:33 +0300 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2021-05-31 09:49:33 +0300 |
commit | 8d571c5a5d32aae4803c3199586b824a5860cd13 (patch) | |
tree | cbb97ae25b5f51edd7aa9c36ce830b19882ea0f3 | |
parent | cb963ea6f2105790b028c597c4d4607b8bfbc276 (diff) | |
download | kdeltachat-8d571c5a5d32aae4803c3199586b824a5860cd13.tar.gz kdeltachat-8d571c5a5d32aae4803c3199586b824a5860cd13.zip |
Reset draft after sending a message
-rw-r--r-- | context.cpp | 2 | ||||
-rw-r--r-- | qml/ComposePane.qml | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/context.cpp b/context.cpp index a92c0c2..f3e698a 100644 --- a/context.cpp +++ b/context.cpp @@ -192,7 +192,7 @@ Context::sendTextMessage(uint32_t chatId, QString textToSend) void Context::setDraft(uint32_t chatId, DcMessage *message) { - dc_set_draft(m_context, chatId, message->m_message); + dc_set_draft(m_context, chatId, message ? message->m_message : nullptr); } DcMessage * diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml index 44cbd7c..0ca189d 100644 --- a/qml/ComposePane.qml +++ b/qml/ComposePane.qml @@ -48,6 +48,7 @@ Pane { onClicked: { chatPage.context.sendTextMessage(chatId, messageField.text) messageField.text = "" + context.setDraft(chatId, null) } } } |