Prevent dino from sending whitespace only messages (#821)

Fixes #774.

Co-authored-by: selurvedu <selurvedu@users.noreply.github.com>
This commit is contained in:
selurvedu 2020-04-24 15:35:47 +03:00 committed by GitHub
parent f8f305efe5
commit 231df1bbbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,7 +75,7 @@ public class ChatTextView : ScrolledWindow {
if (event.keyval in new uint[]{Key.Return, Key.KP_Enter}) { if (event.keyval in new uint[]{Key.Return, Key.KP_Enter}) {
if ((event.state & ModifierType.SHIFT_MASK) > 0) { if ((event.state & ModifierType.SHIFT_MASK) > 0) {
text_view.buffer.insert_at_cursor("\n", 1); text_view.buffer.insert_at_cursor("\n", 1);
} else if (text_view.buffer.text != "") { } else if (text_view.buffer.text.strip() != "") {
send_text(); send_text();
edit_history.reset_history(); edit_history.reset_history();
} }