diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-13 04:36:27 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-13 04:36:27 -0400 |
commit | 422eed92fc87799e2b5fc0b4fdacf7f2733ff3b3 (patch) | |
tree | 81ca317d32661a592441c371b5525f690c47bde0 /components/chatinput.cpp | |
parent | 140782c395175345363d6de9cbaf67a024ddf7d8 (diff) | |
download | abaddon-portaudio-422eed92fc87799e2b5fc0b4fdacf7f2733ff3b3.tar.gz abaddon-portaudio-422eed92fc87799e2b5fc0b4fdacf7f2733ff3b3.zip |
handle rate limited channels
Diffstat (limited to 'components/chatinput.cpp')
-rw-r--r-- | components/chatinput.cpp | 5 |
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; } } |