summaryrefslogtreecommitdiff
path: root/components/chatwindow.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-05-07 04:09:07 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2021-05-07 04:09:07 -0400
commitdd7852014fa1dbb4fd95fcc45dccf9e87b272eb6 (patch)
treea8c37f9726b8607be889ae6748e78996e995ce1b /components/chatwindow.cpp
parent712e78b0c87346d826b60d1101db8fd09bedf730 (diff)
downloadabaddon-portaudio-dd7852014fa1dbb4fd95fcc45dccf9e87b272eb6.tar.gz
abaddon-portaudio-dd7852014fa1dbb4fd95fcc45dccf9e87b272eb6.zip
dont allow sending empty messages (fixes #27)
also add a nullptr check just in case
Diffstat (limited to 'components/chatwindow.cpp')
-rw-r--r--components/chatwindow.cpp3
1 files changed, 3 insertions, 0 deletions
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)