handle rate limited channels

This commit is contained in:
ouwou
2021-04-13 04:36:27 -04:00
parent 140782c395
commit 422eed92fc
9 changed files with 181 additions and 6 deletions

View File

@@ -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;
}
}