mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T494, detect callsign in text message
This commit is contained in:
committed by
Mat Sutcliffe
parent
f8c17e10e8
commit
3137af30bb
@@ -118,6 +118,13 @@ namespace BlackMisc
|
||||
return CComSystem::isValidCivilAviationFrequency(m_frequency);
|
||||
}
|
||||
|
||||
bool CTextMessage::mentionsCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
if (callsign.isEmpty()) { return false; }
|
||||
if (m_message.length() < callsign.asString().length()) { return false; }
|
||||
return m_message.contains(callsign.asString(), Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
QString CTextMessage::getAsciiOnlyMessage() const
|
||||
{
|
||||
if (m_message.isEmpty()) { return {}; }
|
||||
|
||||
@@ -85,6 +85,9 @@ namespace BlackMisc
|
||||
//! Get message
|
||||
const QString &getMessage() const { return m_message; }
|
||||
|
||||
//! Is the callsign given mentioned in that message
|
||||
bool mentionsCallsign(const Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! Get ASCII only message
|
||||
QString getAsciiOnlyMessage() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user