diff --git a/src/conference.cpp b/src/conference.cpp index 795ef508451d91aa9a22bbd1ae0331e3f6fb4915..e5d519c89d14187faa83bbc55ad574a35ff3bf92 100644 --- a/src/conference.cpp +++ b/src/conference.cpp @@ -125,7 +125,8 @@ std::string Conference::getStateStr() const } } -ParticipantSet Conference::getParticipantList() const +const ParticipantSet& +Conference::getParticipantList() const { return participants_; } diff --git a/src/conference.h b/src/conference.h index 64abd03b5c8e57765fb91ca452f29a891bff97cf..f4344bb7f479295fb30cf4229d9c2018aa561fe8 100644 --- a/src/conference.h +++ b/src/conference.h @@ -93,7 +93,7 @@ class Conference : public Recordable { /** * Get the participant list for this conference */ - ParticipantSet getParticipantList() const; + const ParticipantSet& getParticipantList() const; /** * Get the display names or peer numbers for this conference diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index 9e06bf880e7bd4cccc7de03cd2814aedcabf9e1f..a60a8af0506a364ec35e382a8b0af4761c867a82 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -384,10 +384,10 @@ JamiAccount::newOutgoingCall(const std::string& toUrl, startOutgoingCall(call, toUri); } catch (...) { #if HAVE_RINGNS - NameDirectory::lookupUri(suffix, nameServer_, [wthis_=weak(),call](const std::string& result, + NameDirectory::lookupUri(suffix, nameServer_, [wthis_=weak(), call](const std::string& result, NameDirectory::Response response) { // we may run inside an unknown thread, but following code must be called in main thread - runOnMainThread([=, &result]() { + runOnMainThread([wthis_, result, response, call]() { if (response != NameDirectory::Response::found) { call->onFailure(EINVAL); return; diff --git a/src/manager.cpp b/src/manager.cpp index c67163a224cd2276aec5a03aee6c49069764e6ed..35b6cabe33ec48b3944a1be582c27079ca34ff70 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -2940,16 +2940,14 @@ Manager::getDisplayNames(const std::string& confID) const std::vector<std::string> Manager::getParticipantList(const std::string& confID) const { - std::vector<std::string> v; - ConferenceMap::const_iterator iter_conf = pimpl_->conferenceMap_.find(confID); - + auto iter_conf = pimpl_->conferenceMap_.find(confID); if (iter_conf != pimpl_->conferenceMap_.end()) { - const ParticipantSet participants(iter_conf->second->getParticipantList()); - std::copy(participants.begin(), participants.end(), std::back_inserter(v));; + const ParticipantSet& participants(iter_conf->second->getParticipantList()); + return {participants.begin(), participants.end()}; } else JAMI_WARN("Did not find conference %s", confID.c_str()); - return v; + return {}; } std::string