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

conference: fix update missing at the end of conference

Change-Id: I99eec91ed65ab5c2a6d2b0e021e1490d0d7b5df1
Gitlab: #505
parent ef90dd18
No related branches found
No related tags found
No related merge requests found
......@@ -691,7 +691,32 @@ Call::sendConfOrder(const Json::Value& root)
wbuilder["commentStyle"] = "None";
wbuilder["indentation"] = "";
messages["application/confOrder+json"] = Json::writeString(wbuilder, root);
sendTextMessage(messages, getPeerDisplayName());
auto w = getAccount();
auto account = w.lock();
if (account)
sendTextMessage(messages, account->getFromUri());
}
void
Call::sendConfInfo(const std::string& json)
{
std::map<std::string, std::string> messages;
Json::StreamWriterBuilder wbuilder;
wbuilder["commentStyle"] = "None";
wbuilder["indentation"] = "";
messages["application/confInfo+json"] = json;
auto w = getAccount();
auto account = w.lock();
if (account)
sendTextMessage(messages, account->getFromUri());
}
void
Call::resetConfInfo()
{
sendConfInfo("{}");
}
} // namespace jami
......@@ -347,6 +347,8 @@ public: // media management
std::unique_ptr<AudioDeviceGuard> audioGuard;
void sendConfOrder(const Json::Value& root);
void sendConfInfo(const std::string& json);
void resetConfInfo();
protected:
virtual void merge(Call& scall);
......
......@@ -143,14 +143,7 @@ Conference::~Conference()
if (auto call = getCall(participant_id)) {
call->exitConference();
// Reset distant callInfo
auto w = call->getAccount();
auto account = w.lock();
if (!account)
continue;
call->sendTextMessage(std::map<std::string, std::string> {{"application/confInfo+json",
"[]"}},
account->getFromUri());
call->resetConfInfo();
// Trigger the SIP negotiation to update the resolution for the remaining call
// ideally this sould be done without renegotiation
call->switchInput(
......@@ -398,9 +391,8 @@ Conference::sendConferenceInfos()
dht::ThreadPool::io().run([call,
confInfo = getConfInfoHostUri(account->getUsername()
+ "@ring.dht",
call->getPeerNumber()),
from = account->getFromUri()] {
call->sendTextMessage({{"application/confInfo+json", confInfo.toString()}}, from);
call->getPeerNumber())] {
call->sendConfInfo(confInfo.toString());
});
}
}
......
......@@ -1098,8 +1098,13 @@ Manager::hangupConference(const std::string& id)
JAMI_DBG("Hangup conference %s", id.c_str());
if (auto conf = getConferenceFromID(id)) {
ParticipantSet participants(conf->getParticipantList());
for (const auto& item : participants)
hangupCall(item);
for (const auto& callId : participants) {
if (auto call = getCallFromCallID(callId)) {
call->resetConfInfo();
call->exitConference();
}
hangupCall(callId);
}
pimpl_->unsetCurrentCall();
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment