QT for some reason messes with XCompose causing broken input (Qt 5 only - Qt 4 did not break anything). In Qt 5.2 and 5.3 this was causing an invalid conversion in chat messages containing these resulting in the bad bytes being stripped. In Qt 5.9 it is still broken, but you at least get a string with something in it. This checks for non-zero converted strings for room creation and chat lines.
authornemo
Fri, 13 Apr 2018 13:03:51 -0400
changeset 13322 b77a9380dd0f
parent 13321 23ade5604f8d
child 13323 15d804dcd736
QT for some reason messes with XCompose causing broken input (Qt 5 only - Qt 4 did not break anything). In Qt 5.2 and 5.3 this was causing an invalid conversion in chat messages containing these resulting in the bad bytes being stripped. In Qt 5.9 it is still broken, but you at least get a string with something in it. This checks for non-zero converted strings for room creation and chat lines.
QTfrontend/net/newnetclient.cpp
QTfrontend/net/newnetclient.h
--- a/QTfrontend/net/newnetclient.cpp	Fri Apr 13 00:17:30 2018 +0200
+++ b/QTfrontend/net/newnetclient.cpp	Fri Apr 13 13:03:51 2018 -0400
@@ -99,7 +99,7 @@
 
 void HWNewNet::CreateRoom(const QString & room, const QString & password)
 {
-    if(netClientState != InLobby)
+    if(netClientState != InLobby || !ByteLength(room))
     {
         qWarning("Illegal try to create room!");
         return;
@@ -176,6 +176,11 @@
     RawSendNet(QString("EM%1%2").arg(delimiter).arg(msg));
 }
 
+int HWNewNet::ByteLength(const QString & str)
+{
+	return str.toUtf8().size();
+}
+
 void HWNewNet::RawSendNet(const QString & str)
 {
     RawSendNet(str.toUtf8());
@@ -909,7 +914,7 @@
 
 void HWNewNet::chatLineToNet(const QString& str)
 {
-    if(str != "")
+    if(ByteLength(str))
     {
         RawSendNet(QString("CHAT") + delimiter + str);
         QString action = HWProto::chatStringToAction(str);
@@ -922,7 +927,7 @@
 
 void HWNewNet::chatLineToLobby(const QString& str)
 {
-    if(str != "")
+    if(ByteLength(str))
     {
         RawSendNet(QString("CHAT") + delimiter + str);
         QString action = HWProto::chatStringToAction(str);
--- a/QTfrontend/net/newnetclient.h	Fri Apr 13 00:17:30 2018 +0200
+++ b/QTfrontend/net/newnetclient.h	Fri Apr 13 13:03:51 2018 -0400
@@ -84,6 +84,7 @@
 
         QStringList cmdbuf;
 
+        int  ByteLength(const QString & str);
         void RawSendNet(const QString & buf);
         void RawSendNet(const QByteArray & buf);
         void ParseCmd(const QStringList & lst);