Commit 19c5c27c authored by Sébastien Blin's avatar Sébastien Blin

newcallmodel: ignore potential ring://

Change-Id: I4500a864c5cc65f357121a90907fd2261bff594e
parent 8d737130
......@@ -37,6 +37,7 @@
#include "vcard.h"
#include "video/renderer.h"
#include "typedefs.h"
#include "uri.h"
// Ring daemon
#include <media_const.h>
......@@ -206,10 +207,13 @@ NewCallModel::~NewCallModel()
const call::Info&
NewCallModel::getCallFromURI(const QString& uri, bool notOver) const
{
// peer url = ring:uri or sip number
auto url = (owner.profileInfo.type != profile::Type::SIP && !uri.contains("ring:")) ? "ring:" + uri : uri;
// For a NON SIP account the scheme can be ring:. Sometimes it can miss, and will be certainly
// replaced by jami://.
// Just make the comparaison ignoring the scheme and check the rest.
auto uriObj = URI(uri);
for (const auto& call: pimpl_->calls) {
if (call.second->peerUri == url) {
auto contactUri = URI(call.second->peerUri);
if (uriObj.userinfo() == contactUri.userinfo() and uriObj.hostname() == contactUri.hostname()) {
if (!notOver || !call::isTerminating(call.second->status))
return *call.second;
}
......
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