mirror of
https://github.com/uowuo/abaddon.git
synced 2026-01-18 15:00:05 +00:00
dont allow sending empty messages (fixes #27)
also add a nullptr check just in case
This commit is contained in:
@@ -143,8 +143,10 @@ void ChatMessageItemContainer::UpdateReactions() {
|
||||
}
|
||||
|
||||
void ChatMessageItemContainer::SetFailed() {
|
||||
m_text_component->get_style_context()->remove_class("pending");
|
||||
m_text_component->get_style_context()->add_class("failed");
|
||||
if (m_text_component != nullptr) {
|
||||
m_text_component->get_style_context()->remove_class("pending");
|
||||
m_text_component->get_style_context()->add_class("failed");
|
||||
}
|
||||
}
|
||||
|
||||
void ChatMessageItemContainer::UpdateAttributes() {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user