From 4de968d2f0720466f921b2a07c4bd3a435975e80 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Fri, 13 Jul 2018 21:58:43 -0400 Subject: [PATCH] Try to prevent false directed decodes --- decodedtext.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/decodedtext.cpp b/decodedtext.cpp index 7bb41fa..0631364 100644 --- a/decodedtext.cpp +++ b/decodedtext.cpp @@ -60,7 +60,12 @@ DecodedText::DecodedText (QString const& the_string, bool contest_mode, QString } void DecodedText::tryUnpackDirected(){ - QStringList parts = Varicode::unpackDirectedMessage(message()); + QString m = message().trimmed(); + if(m.length() < 12 || m.contains(' ')){ + return; + } + + QStringList parts = Varicode::unpackDirectedMessage(m); if(parts.isEmpty()){ return; @@ -68,6 +73,7 @@ void DecodedText::tryUnpackDirected(){ // replace it with the correct unpacked message_ = QString("%1:%2%3").arg(parts.at(0), parts.at(1), parts.at(2)); + directed_ = parts; }