Skip to content
Snippets Groups Projects
Commit 4cbfe7a9 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Ming Rui Zhang
Browse files

calladapter: initialize auto answer calls for non-current accounts

Gitlab: #193
Change-Id: I9ab1c298a1f720165affa55c0350bb27dfd67030
parent 3ade8ee1
No related branches found
No related tags found
No related merge requests found
......@@ -227,6 +227,11 @@ CallAdapter::updateCall(const QString& convUid, const QString& accountId, bool f
emit callSetupMainViewRequired(accountId_, convUid_);
updateCallOverlay(convInfo);
emit previewVisibilityNeedToChange(shouldShowPreview(forceCallOnly));
if (call->status == lrc::api::call::Status::IN_PROGRESS) {
LRCInstance::renderer()->addDistantRenderer(call->id);
LRCInstance::getAccountInfo(accountId).callModel->setCurrentCall(call->id);
}
}
bool
......@@ -457,9 +462,7 @@ CallAdapter::connectCallModel(const QString& accountId)
if (!convInfo.uid.isEmpty() && convInfo.uid == LRCInstance::getCurrentConvUid()) {
accInfo.conversationModel->selectConversation(convInfo.uid);
}
LRCInstance::renderer()->addDistantRenderer(callId);
updateCall(convInfo.uid, accountId);
LRCInstance::getAccountInfo(accountId).callModel->setCurrentCall(callId);
break;
}
case lrc::api::call::Status::PAUSED:
......
......@@ -70,6 +70,9 @@ public:
Q_INVOKABLE void muteParticipant(const QString& uri, const bool state);
Q_INVOKABLE bool isMuted(const QString& uri) const;
Q_INVOKABLE void hangupParticipant(const QString& uri);
Q_INVOKABLE void updateCall(const QString& convUid = {},
const QString& accountId = {},
bool forceCallOnly = false);
signals:
void callStatusChanged(int index, const QString& accountId, const QString& convUid);
......@@ -101,9 +104,6 @@ public slots:
void slotAccountChanged();
private:
void updateCall(const QString& convUid = {},
const QString& accountId = {},
bool forceCallOnly = false);
bool shouldShowPreview(bool force);
void showNotification(const QString& accountId, const QString& convUid);
......
......@@ -148,6 +148,7 @@ Window {
AccountAdapter.currentAccountId)
ConversationsAdapter.selectConversation(
AccountAdapter.currentAccountId, callConv)
CallAdapter.updateCall(callConv, currentAccountId)
} else {
showWelcomeView()
}
......
......@@ -269,6 +269,14 @@ RenderManager::addDistantRenderer(const QString& id)
* Connect FrameWrapper to avmodel.
*/
dfw->connectStartRendering();
try {
/*
* If the renderer has already started, then start the slot.
*/
if (avModel_.getRenderer(id).isRendering())
dfw->slotRenderingStarted(id);
} catch (...) {
}
/*
* Add to map.
......
......@@ -89,7 +89,7 @@ signals:
*/
void renderingStopped(const QString& id);
private slots:
public slots:
/*
* Used to listen to AVModel::rendererStarted.
* @param id of the renderer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment