# HG changeset patch # User nemo # Date 1523639031 14400 # Node ID b77a9380dd0fa7abd39f2d87eee62de33d865ce5 # Parent 23ade5604f8d980bcc42d78c7110aabe600caf66 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. diff -r 23ade5604f8d -r b77a9380dd0f QTfrontend/net/newnetclient.cpp --- 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); diff -r 23ade5604f8d -r b77a9380dd0f QTfrontend/net/newnetclient.h --- 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);