~tiagosh/telephony-service/ussd

« back to all changes in this revision

Viewing changes to libtelephonyservice/callmanager.cpp

Merge the changes for multiple account support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
    mNeedsUpdate = true;
108
108
}
109
109
 
110
 
void CallManager::startCall(const QString &phoneNumber)
 
110
void CallManager::startCall(const QString &phoneNumber, const QString &accountId)
111
111
{
 
112
    Tp::AccountPtr account;
 
113
    if (accountId.isNull()) {
 
114
        account = TelepathyHelper::instance()->accounts()[0];
 
115
    } else {
 
116
        account = TelepathyHelper::instance()->accountForId(accountId);
 
117
    }
 
118
 
112
119
    QDBusInterface *phoneAppHandler = TelepathyHelper::instance()->handlerInterface();
113
 
    phoneAppHandler->call("StartCall", phoneNumber);
 
120
    phoneAppHandler->call("StartCall", phoneNumber, account->uniqueIdentifier());
114
121
}
115
122
 
116
123
void CallManager::onConnectedChanged()
121
128
        return;
122
129
    }
123
130
 
124
 
    Tp::ConnectionPtr conn(TelepathyHelper::instance()->account()->connection());
 
131
    // FIXME: needs to handle voicemail numbers from multiple accounts
 
132
    Tp::ConnectionPtr conn(TelepathyHelper::instance()->accounts()[0]->connection());
125
133
    QString busName = conn->busName();
126
134
    QString objectPath = conn->objectPath();
127
135
    QDBusInterface connIface(busName, objectPath, CANONICAL_TELEPHONY_VOICEMAIL_IFACE);