From 422eed92fc87799e2b5fc0b4fdacf7f2733ff3b3 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 13 Apr 2021 04:36:27 -0400 Subject: handle rate limited channels --- components/chatinput.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'components/chatinput.cpp') 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; } } -- cgit v1.2.3