Skip to content
Snippets Groups Projects
Commit cfab4e3a authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2
Browse files

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
Branches
Tags
No related merge requests found
...@@ -195,21 +195,21 @@ RingAccount::newOutgoingCall(const std::string& toUrl) ...@@ -195,21 +195,21 @@ RingAccount::newOutgoingCall(const std::string& toUrl)
setCertificateStatus(toUri, tls::TrustStore::Status::ALLOWED); setCertificateStatus(toUri, tls::TrustStore::Status::ALLOWED);
std::weak_ptr<SIPCall> weak_call = call; std::weak_ptr<SIPCall> weak_call = call;
runOnMainThread([=] { manager.addTask([shared_this, weak_call, ice, iceInitTimeout, toUri] {
auto call = weak_call.lock(); auto call = weak_call.lock();
if (not call) if (not call)
return; return false;
/* First step: wait for an initialized ICE transport for SIP channel */ /* First step: wait for an initialized ICE transport for SIP channel */
if (ice->isFailed() or std::chrono::steady_clock::now() >= iceInitTimeout) { if (ice->isFailed() or std::chrono::steady_clock::now() >= iceInitTimeout) {
RING_DBG("ice init failed (or timeout)"); RING_DBG("ice init failed (or timeout)");
call->onFailure(); call->onFailure();
return; return false;
} }
if (not ice->isInitialized()) if (not ice->isInitialized())
return; return true; // process task again!
/* Next step: sent the ICE data to peer through DHT */ /* Next step: sent the ICE data to peer through DHT */
const dht::Value::Id callvid = udist(shared_this->rand_); const dht::Value::Id callvid = udist(shared_this->rand_);
...@@ -254,6 +254,8 @@ RingAccount::newOutgoingCall(const std::string& toUrl) ...@@ -254,6 +254,8 @@ RingAccount::newOutgoingCall(const std::string& toUrl)
std::move(listenKey), std::move(listenKey),
callkey, toH callkey, toH
}); });
return false;
}); });
return call; return call;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment