summaryrefslogtreecommitdiff
path: root/components/chatinput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'components/chatinput.cpp')
-rw-r--r--components/chatinput.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/chatinput.cpp b/components/chatinput.cpp
index 3c815a4..7ac4e72 100644
--- a/components/chatinput.cpp
+++ b/components/chatinput.cpp
@@ -44,8 +44,9 @@ bool ChatInput::ProcessKeyPress(GdkEventKey *event) {
auto text = buf->get_text();
// sometimes a message thats just newlines can sneak in if you hold down enter
if (text.size() > 0 && !std::all_of(text.begin(), text.end(), [](gunichar c) -> bool { return c == gunichar('\n'); })) {
- buf->set_text("");
- m_signal_submit.emit(text);
+ const bool accepted = m_signal_submit.emit(text);
+ if (accepted)
+ buf->set_text("");
return true;
}
}