diff --git a/src/blackcore/context/contextnetworkimpl.cpp b/src/blackcore/context/contextnetworkimpl.cpp index 7151addca..9b5c684fc 100644 --- a/src/blackcore/context/contextnetworkimpl.cpp +++ b/src/blackcore/context/contextnetworkimpl.cpp @@ -314,15 +314,17 @@ namespace BlackCore CTextMessage tm; tm.setSenderCallsign(ownAircraft.getCallsign()); - if (receiver.startsWith("c") && receiver.endsWith("1")) + // based on the CPZ bug https://discordapp.com/channels/539048679160676382/539486309882789888/576765888401768449 + // no longer use starts/ends with + if (receiver == QStringView(u"c1") || receiver == QStringView(u"com1") || receiver == QStringView(u"comm1")) { tm.setFrequency(ownAircraft.getCom1System().getFrequencyActive()); } - else if (receiver.startsWith("c") && receiver.endsWith("2")) + else if (receiver == QStringView(u"c2") || receiver == QStringView(u"com2") || receiver == QStringView(u"comm2")) { tm.setFrequency(ownAircraft.getCom2System().getFrequencyActive()); } - else if (receiver == "u" || receiver.startsWith("uni")) + else if (receiver == "u" || receiver == QStringView(u"uni") || receiver == QStringView(u"unicom")) { tm.setFrequency(CPhysicalQuantitiesConstants::FrequencyUnicom()); } diff --git a/src/blackgui/components/textmessagecomponent.cpp b/src/blackgui/components/textmessagecomponent.cpp index 4eb4a572a..e959bc143 100644 --- a/src/blackgui/components/textmessagecomponent.cpp +++ b/src/blackgui/components/textmessagecomponent.cpp @@ -89,7 +89,7 @@ namespace BlackGui if (sGui && sGui->getCoreFacade() && sGui->getIContextNetwork() && sGui->getIContextOwnAircraft()) { - c = connect(this, &CTextMessageComponent::commandEntered, sGui->getCoreFacade(), &CCoreFacade::parseCommandLine); + c = connect(this, &CTextMessageComponent::commandEntered, sGui->getCoreFacade(), &CCoreFacade::parseCommandLine, Qt::QueuedConnection); Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect"); c = connect(sGui->getIContextNetwork(), &IContextNetwork::textMessagesReceived, this, &CTextMessageComponent::onTextMessageReceived, Qt::QueuedConnection); Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");