Commit cfab4e3a authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2

ringaccount: use manager.addTask than runOnMainThread

This was introduced by changes a8013d76, but it's a mistake as
we need to keep control on returned value.

Issue: #78264
Change-Id: Ibb5bf8d5e40bf4a5963170f293cb3ea15f80fdab
parent 24a3d6db
......@@ -195,21 +195,21 @@ RingAccount::newOutgoingCall(const std::string& toUrl)
setCertificateStatus(toUri, tls::TrustStore::Status::ALLOWED);
std::weak_ptr<SIPCall> weak_call = call;
runOnMainThread([=] {
manager.addTask([shared_this, weak_call, ice, iceInitTimeout, toUri] {
auto call = weak_call.lock();
if (not call)
return;
return false;
/* First step: wait for an initialized ICE transport for SIP channel */
if (ice->isFailed() or std::chrono::steady_clock::now() >= iceInitTimeout) {
RING_DBG("ice init failed (or timeout)");
call->onFailure();
return;
return false;
}
if (not ice->isInitialized())
return;
return true; // process task again!
/* Next step: sent the ICE data to peer through DHT */
const dht::Value::Id callvid = udist(shared_this->rand_);
......@@ -254,6 +254,8 @@ RingAccount::newOutgoingCall(const std::string& toUrl)
std::move(listenKey),
callkey, toH
});
return false;
});
return call;
......
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