ChatView: prevent sending only whitespace

Check the trimmed input string to prevent sending whitespace only,
but send the original string.

Change-Id: If713154c68e28ee2a43f1864a8bc8d5234a6b231
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
diff --git a/src/chatview.cpp b/src/chatview.cpp
index 5ab0da7..9bc6b57 100644
--- a/src/chatview.cpp
+++ b/src/chatview.cpp
@@ -120,9 +120,9 @@
     g_return_if_fail(IS_CHAT_VIEW(self));
     ChatViewPrivate *priv = CHAT_VIEW_GET_PRIVATE(self);
 
-    /* make sure there is text to send */
-    const gchar *text = gtk_entry_get_text(GTK_ENTRY(priv->entry_chat_input));
-    if (text && strlen(text) > 0) {
+    /* make sure there is more than just whitespace, but if so, send the original text */
+    const auto text = QString(gtk_entry_get_text(GTK_ENTRY(priv->entry_chat_input)));
+    if (!text.trimmed().isEmpty()) {
         QMap<QString, QString> messages;
         messages["text/plain"] = text;