mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
refs #240, get user for callsign method in network context
This commit is contained in:
@@ -98,6 +98,9 @@ namespace BlackCore
|
||||
//! Users for given callsigns, e.g. for voice room resolution
|
||||
virtual BlackMisc::Network::CUserList getUsersForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const = 0;
|
||||
|
||||
//! User for given callsign, e.g. for text messages
|
||||
virtual BlackMisc::Network::CUser getUserForCallsign(const BlackMisc::Aviation::CCallsign &callsign) const = 0;
|
||||
|
||||
//! Get own aircraft
|
||||
virtual BlackMisc::Aviation::CAircraft getOwnAircraft() const = 0;
|
||||
|
||||
|
||||
@@ -357,6 +357,18 @@ namespace BlackCore
|
||||
return users;
|
||||
}
|
||||
|
||||
/*
|
||||
* User for callsign
|
||||
*/
|
||||
CUser CContextNetwork::getUserForCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
CCallsignList callsigns;
|
||||
callsigns.push_back(callsign);
|
||||
CUserList users = this->getUsersForCallsigns(callsigns);
|
||||
if (users.size() < 1) return CUser();
|
||||
return users[0];
|
||||
}
|
||||
|
||||
/*
|
||||
* Other clients
|
||||
*/
|
||||
|
||||
@@ -106,6 +106,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextNetwork::getUsersForCallsigns
|
||||
virtual BlackMisc::Network::CUserList getUsersForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const override;
|
||||
|
||||
//! \copydoc IContextNetwork::getUsersForCallsign
|
||||
virtual BlackMisc::Network::CUser getUserForCallsign(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
|
||||
//! \copydoc IContextNetwork::getOtherClients
|
||||
virtual BlackMisc::Network::CClientList getOtherClients() const override;
|
||||
|
||||
|
||||
@@ -93,6 +93,11 @@ namespace BlackCore
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Network::CUserList>(QLatin1Literal("getUsersForCallsigns"), callsigns);
|
||||
}
|
||||
|
||||
BlackMisc::Network::CUser CContextNetworkProxy::getUserForCallsign(const BlackMisc::Aviation::CCallsign &callsign) const
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Network::CUser>(QLatin1Literal("getUserForCallsign"), callsign);
|
||||
}
|
||||
|
||||
BlackMisc::Network::CClientList CContextNetworkProxy::getOtherClients() const
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Network::CClientList>(QLatin1Literal("getOtherClients"));
|
||||
|
||||
@@ -119,6 +119,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextNetwork::getUsersForCallsigns
|
||||
virtual BlackMisc::Network::CUserList getUsersForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const override;
|
||||
|
||||
//! \copydoc IContextNetwork::getUserForCallsign
|
||||
virtual BlackMisc::Network::CUser getUserForCallsign(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
|
||||
//! \copydoc IContextNetwork::getOtherClients
|
||||
virtual BlackMisc::Network::CClientList getOtherClients() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user