Correct highlighting of messages with myCall and 73

This commit is contained in:
Uwe Risse 2022-01-21 16:49:03 +01:00
parent 5c1b7a8d8f
commit 5c09e55351

View File

@ -414,19 +414,6 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
else
{
if (bCQonly) return;
if (myCall.size ())
{
QString regexp {"[ <]" + myCall + "[ >]"};
if (Radio::is_compound_callsign (myCall))
{
regexp = "(?:" + regexp + "|[ <]" + Radio::base_callsign (myCall) + "[ >])";
}
if ((decodedText.clean_string () + " ").contains (QRegularExpression {regexp}))
{
highlight_types types {Highlight::MyCall};
set_colours (m_config, &bg, &fg, types);
}
}
}
auto message = decodedText.string();
QString dxCall;
@ -473,6 +460,20 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
message = leftJustifyAppendage (message, extra);
}
if (myCall.size ())
{
QString regexp {"[ <]" + myCall + "[ >]"};
if (Radio::is_compound_callsign (myCall))
{
regexp = "(?:" + regexp + "|[ <]" + Radio::base_callsign (myCall) + "[ >])";
}
if ((decodedText.clean_string () + " ").contains (QRegularExpression {regexp}))
{
highlight_types types {Highlight::MyCall};
set_colours (m_config, &bg, &fg, types);
}
}
appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall);
}