aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context.cpp2
-rw-r--r--qml/ComposePane.qml1
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)
}
}
}