diff --git a/src/callmodel.cpp b/src/callmodel.cpp index e23bde525f8ae3797a49a5cb06e575bfd57445b0..36c5d10598e6e6f4123af87104092f710f2d85bc 100644 --- a/src/callmodel.cpp +++ b/src/callmodel.cpp @@ -480,6 +480,14 @@ Call* CallModelPrivate::addCall2(Call* call, Call* parentCall) return call; } //addCall +///Return the current or create a new dialing call from peer ContactMethod +Call* CallModel::dialingCall(ContactMethod* cm) +{ + auto call = dialingCall(); + call->setPeerContactMethod(cm); + return call; +} + ///Return the current or create a new dialing call from peer name and the account Call* CallModel::dialingCall(const QString& peerName, Account* account) { diff --git a/src/callmodel.h b/src/callmodel.h index 64d784e9310d68895b5a229dd8f9c95d101d70e8..4d2f87987c54777a36be83b6dc782bea0ce7e1b5 100644 --- a/src/callmodel.h +++ b/src/callmodel.h @@ -80,6 +80,7 @@ public: //Call related Q_INVOKABLE Call* dialingCall ( const QString& peerName=QString(), Account* account=nullptr ); + Q_INVOKABLE Call* dialingCall ( ContactMethod* cm ); Q_INVOKABLE void attendedTransfer ( Call* toTransfer , Call* target ); Q_INVOKABLE void transfer ( Call* toTransfer , const ContactMethod* target ); Q_INVOKABLE QByteArray getMime ( const Call* call ) const; @@ -163,4 +164,3 @@ Q_SIGNALS: void mediaStateChanged( Call* call, Media::Media* media, const Media::Media::State s, const Media::Media::State m); }; Q_DECLARE_METATYPE(CallModel*) -