api: filter-out subcall from getCallList() API

Internal subcalls don't have to be exposed to clients.
This patch prevents to be listed by getCallList() API.

Change-Id: If8f72670767f0a19ccc45255c9a44eabd534a7bf
Tuleap: #1526
This commit is contained in:
Guillaume Roguez
2017-05-04 15:10:32 -04:00
parent 11c13b61fb
commit 3677c2a6d9
3 changed files with 15 additions and 3 deletions

View File

@ -258,6 +258,13 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
*/
void addSubCall(Call& call);
///
/// Return true if this call instance is a subcall (internal call for multi-device handling)
///
bool isSubcall() const {
return parent_.load() != nullptr;
}
public: // media management
virtual bool toggleRecording();

View File

@ -2816,7 +2816,12 @@ Manager::getCallDetails(const std::string &callID)
std::vector<std::string>
Manager::getCallList() const
{
return callFactory.getCallIDs();
std::vector<std::string> results;
for (auto call: callFactory.getAllCalls()) {
if (!call->isSubcall())
results.push_back(call->getCallId());
}
return results;
}
std::map<std::string, std::string>

View File

@ -417,8 +417,8 @@ class Manager {
std::map<std::string, std::string> getCallDetails(const std::string& callID);
/**
* Get call list
* @return std::vector<std::string> A list of call IDs
* Get list of calls (internal subcalls are filter-out)
* @return std::vector<std::string> A list of call IDs (without subcalls)
*/
std::vector<std::string> getCallList() const;