Commit dbb214f9 authored by Benjamin REIS's avatar Benjamin REIS
Browse files

add method to create the resource-lists xml body for conference creation

parent 4bc82605
......@@ -97,6 +97,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
utils/payload-type-handler.h
variant/variant.h
xml/conference-info.h
xml/resource-lists.h
xml/xml.h
)
......@@ -162,6 +163,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
utils/utils.cpp
variant/variant.cpp
xml/conference-info.cpp
xml/resource-lists.cpp
xml/xml.cpp
)
......
......@@ -18,8 +18,10 @@
#include "remote-conference.h"
#include "participant-p.h"
#include "xml/resource-lists.h"
using namespace std;
using namespace LinphonePrivate::Xsd::ResourceLists;
LINPHONE_BEGIN_NAMESPACE
......@@ -57,6 +59,25 @@ void RemoteConference::removeParticipant (const shared_ptr<const Participant> &p
}
}
string RemoteConference::getResourceLists(const list<shared_ptr<const Participant>> &participants) {
ResourceLists rl = ResourceLists();
ListType l = ListType();
for(const auto &p : participants) {
EntryType entry = EntryType(p->getAddress().asStringUriOnly());
if(p->getAddress().getDisplayName() != "") {
entry.setDisplayName(DisplayName(p->getAddress().getDisplayName()));
}
l.getEntry().push_back(entry);
}
rl.getList().push_back(l);
Xsd::XmlSchema::NamespaceInfomap map;
stringstream xmlBody;
serializeResourceLists(xmlBody, rl, map);
return xmlBody.str();
}
// -----------------------------------------------------------------------------
void RemoteConference::onConferenceCreated (const Address &addr) {}
......
......@@ -39,6 +39,8 @@ public:
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
std::string getResourceLists(const std::list<std::shared_ptr<const Participant>> &participants);
protected:
/* ConferenceListener */
void onConferenceCreated (const Address &addr) override;
......
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