Skip to content
Snippets Groups Projects
Commit ce70f18d authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

lrc: add status code to callStatusChanged signal

Change-Id: I2279c8a59b7dc3f33fba3b703b20b78e24a21d48
parent c6983802
Branches
No related tags found
No related merge requests found
......@@ -197,7 +197,7 @@ Q_SIGNALS:
* Emitted when a call state changes
* @param callId
*/
void callStatusChanged(const std::string& callId) const;
void callStatusChanged(const std::string& callId, int code) const;
/**
* Emitted when a call starts
* @param callId
......
......@@ -208,7 +208,7 @@ public Q_SLOTS:
* Listen from callmodel for calls status changed.
* @param callId
*/
void slotCallStatusChanged(const std::string& callId);
void slotCallStatusChanged(const std::string& callId, int code);
/**
* Listen from callmodel for writing "Call started"
* @param callId
......@@ -1499,8 +1499,9 @@ ConversationModelPimpl::slotIncomingCall(const std::string& fromId, const std::s
}
void
ConversationModelPimpl::slotCallStatusChanged(const std::string& callId)
ConversationModelPimpl::slotCallStatusChanged(const std::string& callId, int code)
{
Q_UNUSED(code)
// Get conversation
auto i = std::find_if(
conversations.begin(), conversations.end(),
......
......@@ -506,7 +506,6 @@ NewCallModelPimpl::slotIncomingCall(const std::string& accountId, const std::str
void
NewCallModelPimpl::slotCallStateChanged(const std::string& callId, const std::string& state, int code)
{
Q_UNUSED(code)
if (!linked.hasCall(callId)) return;
auto status = call::to_status(state);
......@@ -514,7 +513,7 @@ NewCallModelPimpl::slotCallStateChanged(const std::string& callId, const std::st
if (status == call::Status::ENDED && !call::isTerminating(call->status)) {
call->status = call::Status::TERMINATING;
emit linked.callStatusChanged(callId);
emit linked.callStatusChanged(callId, code);
}
// proper state transition
......@@ -530,7 +529,7 @@ NewCallModelPimpl::slotCallStateChanged(const std::string& callId, const std::st
call::to_string(previousStatus).c_str(), call::to_string(status).c_str());
// NOTE: signal emission order matters, always emit CallStatusChanged before CallEnded
emit linked.callStatusChanged(callId);
emit linked.callStatusChanged(callId, code);
if (call->status == call::Status::ENDED) {
emit linked.callEnded(callId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment