dialer: use the number directly instead of checking contactManager

There's existing todo item to make it use the kpeople instead of
telepathy contact manager, no need to deal with telepathy contact
manager, in some setups it causes crasher.

See: !22
This commit is contained in:
Bhushan Shah 2019-09-13 17:16:51 +05:30
parent 2a11f0baa3
commit 69144b0baa

View file

@ -55,21 +55,13 @@ DialerUtils::~DialerUtils()
void DialerUtils::dial(const QString &number)
{
// FIXME: this should be replaced by kpeople thing
auto pendingContact = m_simAccount->connection()->contactManager()->contactsForIdentifiers(QStringList() << number);
connect(pendingContact, &Tp::PendingOperation::finished, [=](){
if (pendingContact->contacts().size() < 1) {
qWarning() << " no contacts";
return;
qDebug() << "Starting call...";
Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(number);
connect(pendingChannel, &Tp::PendingChannelRequest::finished, [=](){
if (pendingChannel->isError()) {
qWarning() << "Error when requesting channel" << pendingChannel->errorMessage();
setCallState("failed");
}
qDebug() << "Starting call...";
Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(pendingContact->contacts().first());
connect(pendingChannel, &Tp::PendingChannelRequest::finished, [=](){
if (pendingChannel->isError()) {
qWarning() << "Error when requesting channel" << pendingChannel->errorMessage();
setCallState("failed");
}
});
});
}