diff --git a/daemon/src/client/callmanager.cpp b/daemon/src/client/callmanager.cpp index 398b52bfbb0886b72a735e57972118682b4d5ecd..5152a59e8b9d823422550578441f6357fd391206 100644 --- a/daemon/src/client/callmanager.cpp +++ b/daemon/src/client/callmanager.cpp @@ -186,6 +186,12 @@ CallManager::getParticipantList(const std::string& confID) return Manager::instance().getParticipantList(confID); } +std::vector<std::string> +CallManager::getDisplayNames(const std::string& confID) +{ + return Manager::instance().getDisplayNames(confID); +} + std::string CallManager::getConferenceId(const std::string& callID) { diff --git a/daemon/src/client/callmanager.h b/daemon/src/client/callmanager.h index 0ad19356cfc558d82e175ea81d10b5a12c5d76d5..d85f8ad56a50683f3d163b638f21352e870f9784 100644 --- a/daemon/src/client/callmanager.h +++ b/daemon/src/client/callmanager.h @@ -120,6 +120,7 @@ class CallManager bool unholdConference(const std::string& confID); std::vector<std::string> getConferenceList(); 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::map<std::string, std::string> getConferenceDetails(const std::string& callID); diff --git a/daemon/src/client/dbus/callmanager-introspec.xml b/daemon/src/client/dbus/callmanager-introspec.xml index bd97bdff75af2b17f5935f947e7b30318d20f55c..41896bcc992f69c0c4ffbcd902af99195386dc9d 100644 --- a/daemon/src/client/dbus/callmanager-introspec.xml +++ b/daemon/src/client/dbus/callmanager-introspec.xml @@ -534,6 +534,23 @@ </arg> </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"> <tp:added version="0.9.7"/> <tp:docstring> diff --git a/daemon/src/conference.cpp b/daemon/src/conference.cpp index 87e88614386d2a50a7d19ba4d4b7d006cea274f5..0d745868ebd4d7b3f86e51ae0204adada9f45203 100644 --- a/daemon/src/conference.cpp +++ b/daemon/src/conference.cpp @@ -139,6 +139,19 @@ ParticipantSet Conference::getParticipantList() const 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() { const bool startRecording = Recordable::toggleRecording(); diff --git a/daemon/src/conference.h b/daemon/src/conference.h index 52856c60fbae4e3bc04bc2747189f8ee1ccb7466..e2203da2e5153a61b80da09068959bb01aff16df 100644 --- a/daemon/src/conference.h +++ b/daemon/src/conference.h @@ -100,6 +100,12 @@ class Conference : public Recordable { */ ParticipantSet getParticipantList() const; + /** + * Get the display names or peer numbers for this conference + */ + std::vector<std::string> + getDisplayNames() const; + /** * Start/stop recording toggle */ diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index e9b388e9be42a034f6d067a93cb5ea5e0af83d82..34e00fe46e64f5a3fb632e4c47c1b37a71db1472 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -2798,7 +2798,23 @@ std::vector<std::string> ManagerImpl::getConferenceList() const 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; ConferenceMap::const_iterator iter_conf = conferenceMap_.find(confID); diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h index 256f2430d33f1f0e5b72801901f937fecdd2176e..2f4a76f7676232893c3db4570b83ade383353848 100644 --- a/daemon/src/managerimpl.h +++ b/daemon/src/managerimpl.h @@ -480,6 +480,12 @@ class ManagerImpl { */ 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); /** diff --git a/gnome/src/dbus/callmanager-introspec.xml b/gnome/src/dbus/callmanager-introspec.xml index bd97bdff75af2b17f5935f947e7b30318d20f55c..41896bcc992f69c0c4ffbcd902af99195386dc9d 100644 --- a/gnome/src/dbus/callmanager-introspec.xml +++ b/gnome/src/dbus/callmanager-introspec.xml @@ -534,6 +534,23 @@ </arg> </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"> <tp:added version="0.9.7"/> <tp:docstring>