From dd7852014fa1dbb4fd95fcc45dccf9e87b272eb6 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Fri, 7 May 2021 04:09:07 -0400 Subject: dont allow sending empty messages (fixes #27) also add a nullptr check just in case --- components/chatwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'components/chatwindow.cpp') diff --git a/components/chatwindow.cpp b/components/chatwindow.cpp index 1a2bb48..55ff06d 100644 --- a/components/chatwindow.cpp +++ b/components/chatwindow.cpp @@ -200,6 +200,9 @@ bool ChatWindow::OnInputSubmit(const Glib::ustring &text) { if (!m_rate_limit_indicator->CanSpeak()) return false; + if (text.size() == 0) + return false; + if (m_active_channel.IsValid()) m_signal_action_chat_submit.emit(text, m_active_channel, m_replying_to); // m_replying_to is checked for invalid in the handler if (m_is_replying) -- cgit v1.2.3