refs #240, get user for callsign method in network context

This commit is contained in:
Klaus Basan
2014-05-19 18:21:15 +02:00
parent d4d121bed5
commit ca199d393a
5 changed files with 26 additions and 0 deletions

View File

@@ -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;

View File

@@ -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
*/

View File

@@ -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;

View File

@@ -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"));

View File

@@ -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;