Skip to content
Snippets Groups Projects
Commit f35992be authored by Pierre Lespagnol's avatar Pierre Lespagnol
Browse files

conference: allow to receive the new confInfo

Gitlab: #468

Change-Id: I2c94823bb8efab6fccddd59de1ae96f290745691
parent b3c4f995
Branches
No related tags found
No related merge requests found
......@@ -643,12 +643,30 @@ Call::setConferenceInfo(const std::string& msg)
Json::CharReaderBuilder rbuilder;
auto reader = std::unique_ptr<Json::CharReader>(rbuilder.newCharReader());
if (reader->parse(msg.data(), msg.data() + msg.size(), &json, &err)) {
for (const auto& participantInfo : json) {
ParticipantInfo pInfo;
if (!participantInfo.isMember("uri"))
continue;
pInfo.fromJson(participantInfo);
newInfo.emplace_back(pInfo);
if (json.isObject()) {
// new confInfo
if (json.isMember("p")) {
for (const auto& participantInfo : json["p"]) {
ParticipantInfo pInfo;
if (!participantInfo.isMember("uri"))
continue;
pInfo.fromJson(participantInfo);
newInfo.emplace_back(pInfo);
}
}
if (json.isMember("w"))
newInfo.w = json["w"].asInt();
if (json.isMember("h"))
newInfo.h = json["h"].asInt();
} else {
// old confInfo
for (const auto& participantInfo : json) {
ParticipantInfo pInfo;
if (!participantInfo.isMember("uri"))
continue;
pInfo.fromJson(participantInfo);
newInfo.emplace_back(pInfo);
}
}
}
......
......@@ -111,6 +111,8 @@ struct ParticipantInfo
struct ConfInfo : public std::vector<ParticipantInfo>
{
std::vector<std::map<std::string, std::string>> toVectorMapStringString() const;
int h {0};
int w {0};
};
using ParticipantSet = std::set<std::string>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment