Commit 3f6d7c56 authored by Tristan Matthews's avatar Tristan Matthews

daemon: add getDisplayNames(conferenceID) D-Bus method

Refs #45628
parent 7351dad0
...@@ -186,6 +186,12 @@ CallManager::getParticipantList(const std::string& confID) ...@@ -186,6 +186,12 @@ CallManager::getParticipantList(const std::string& confID)
return Manager::instance().getParticipantList(confID); return Manager::instance().getParticipantList(confID);
} }
std::vector<std::string>
CallManager::getDisplayNames(const std::string& confID)
{
return Manager::instance().getDisplayNames(confID);
}
std::string std::string
CallManager::getConferenceId(const std::string& callID) CallManager::getConferenceId(const std::string& callID)
{ {
......
...@@ -120,6 +120,7 @@ class CallManager ...@@ -120,6 +120,7 @@ class CallManager
bool unholdConference(const std::string& confID); bool unholdConference(const std::string& confID);
std::vector<std::string> getConferenceList(); std::vector<std::string> getConferenceList();
std::vector<std::string> getParticipantList(const std::string& confID); std::vector<std::string> getParticipantList(const std::string& confID);
std::vector<std::string> getDisplayNames(const std::string& confID);
std::string getConferenceId(const std::string& callID); std::string getConferenceId(const std::string& callID);
std::map<std::string, std::string> getConferenceDetails(const std::string& callID); std::map<std::string, std::string> getConferenceDetails(const std::string& callID);
......
...@@ -534,6 +534,23 @@ ...@@ -534,6 +534,23 @@
</arg> </arg>
</signal> </signal>
<method name="getDisplayNames" tp:name-for-bindings="getDisplayNames">
<tp:added version="1.3.0"/>
<tp:docstring>
Get the display name of every participant in a given conference, or their number as a fallback.
</tp:docstring>
<arg type="s" name="confID" direction="in">
<tp:docstring>
The conference ID.
</tp:docstring>
</arg>
<arg type="as" name="list" direction="out">
<tp:docstring>
The list of the display names.
</tp:docstring>
</arg>
</method>
<method name="getParticipantList" tp:name-for-bindings="getParticipantList"> <method name="getParticipantList" tp:name-for-bindings="getParticipantList">
<tp:added version="0.9.7"/> <tp:added version="0.9.7"/>
<tp:docstring> <tp:docstring>
......
...@@ -139,6 +139,19 @@ ParticipantSet Conference::getParticipantList() const ...@@ -139,6 +139,19 @@ ParticipantSet Conference::getParticipantList() const
return participants_; return participants_;
} }
std::vector<std::string>
Conference::getDisplayNames() const
{
std::vector<std::string> result;
for (const auto &p : participants_) {
auto details = Manager::instance().getCallDetails(p);
const auto tmp = details["DISPLAY_NAME"];
result.push_back(tmp.empty() ? details["PEER_NUMBER"] : tmp);
}
return result;
}
bool Conference::toggleRecording() bool Conference::toggleRecording()
{ {
const bool startRecording = Recordable::toggleRecording(); const bool startRecording = Recordable::toggleRecording();
......
...@@ -100,6 +100,12 @@ class Conference : public Recordable { ...@@ -100,6 +100,12 @@ class Conference : public Recordable {
*/ */
ParticipantSet getParticipantList() const; ParticipantSet getParticipantList() const;
/**
* Get the display names or peer numbers for this conference
*/
std::vector<std::string>
getDisplayNames() const;
/** /**
* Start/stop recording toggle * Start/stop recording toggle
*/ */
......
...@@ -2798,7 +2798,23 @@ std::vector<std::string> ManagerImpl::getConferenceList() const ...@@ -2798,7 +2798,23 @@ std::vector<std::string> ManagerImpl::getConferenceList() const
return v; return v;
} }
std::vector<std::string> ManagerImpl::getParticipantList(const std::string& confID) const std::vector<std::string>
ManagerImpl::getDisplayNames(const std::string& confID) const
{
std::vector<std::string> v;
ConferenceMap::const_iterator iter_conf = conferenceMap_.find(confID);
if (iter_conf != conferenceMap_.end()) {
return iter_conf->second->getDisplayNames();
} else {
WARN("Did not find conference %s", confID.c_str());
}
return v;
}
std::vector<std::string>
ManagerImpl::getParticipantList(const std::string& confID) const
{ {
std::vector<std::string> v; std::vector<std::string> v;
ConferenceMap::const_iterator iter_conf = conferenceMap_.find(confID); ConferenceMap::const_iterator iter_conf = conferenceMap_.find(confID);
......
...@@ -480,6 +480,12 @@ class ManagerImpl { ...@@ -480,6 +480,12 @@ class ManagerImpl {
*/ */
std::vector<std::string> getParticipantList(const std::string& confID) const; std::vector<std::string> getParticipantList(const std::string& confID) const;
/**
* Get a list of the display names for everyone in a conference
* @return std::vector<std::string> A list of display names
*/
std::vector<std::string> getDisplayNames(const std::string& confID) const;
std::string getConferenceId(const std::string& callID); std::string getConferenceId(const std::string& callID);
/** /**
......
...@@ -534,6 +534,23 @@ ...@@ -534,6 +534,23 @@
</arg> </arg>
</signal> </signal>
<method name="getDisplayNames" tp:name-for-bindings="getDisplayNames">
<tp:added version="1.3.0"/>
<tp:docstring>
Get the display name of every participant in a given conference, or their number as a fallback.
</tp:docstring>
<arg type="s" name="confID" direction="in">
<tp:docstring>
The conference ID.
</tp:docstring>
</arg>
<arg type="as" name="list" direction="out">
<tp:docstring>
The list of the display names.
</tp:docstring>
</arg>
</method>
<method name="getParticipantList" tp:name-for-bindings="getParticipantList"> <method name="getParticipantList" tp:name-for-bindings="getParticipantList">
<tp:added version="0.9.7"/> <tp:added version="0.9.7"/>
<tp:docstring> <tp:docstring>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment