Skip to content
Snippets Groups Projects
Commit 3673b064 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Sébastien Blin
Browse files

conversations: hide call view when swarm call is finished.

In the current implementation, the chatViewContainer of callStackView
is not destroyed for a swarm conference call because there are no
signals for call changes.This patch ensures chatViewContainer is used
when there is no call.

GitLab: #1625
Change-Id: Iefc39b747d92543244d30aa987eda134ff0a03f3
parent 2e2f6423
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,15 @@ ListSelectionView { ...@@ -65,8 +65,15 @@ ListSelectionView {
id: chatView id: chatView
anchors.fill: parent anchors.fill: parent
// Use callStackView.chatViewContainer only when hasCall is true
// and callStackView.chatViewContainer not null.
// Because after a swarm call ends, callStackView.chatViewContainer might not be null
// due to a lack of call state change signals for the swarm call.
readonly property bool hasCall: CurrentConversation.hasCall
readonly property var inCallChatContainer: hasCall ? callStackView.chatViewContainer : null
// Parent the chat view to the call stack view when in call. // Parent the chat view to the call stack view when in call.
parent: callStackView.chatViewContainer ? callStackView.chatViewContainer : chatViewContainer parent: inCallChatContainer ? inCallChatContainer : chatViewContainer
inCallView: parent === callStackView.chatViewContainer inCallView: parent === callStackView.chatViewContainer
readonly property string currentConvId: CurrentConversation.id readonly property string currentConvId: CurrentConversation.id
......
...@@ -186,6 +186,7 @@ public: ...@@ -186,6 +186,7 @@ public:
Lrc& lrc; Lrc& lrc;
QList<call::PendingConferenceeInfo> pendingConferencees_; QList<call::PendingConferenceeInfo> pendingConferencees_;
QString waitForConference_ {};
public Q_SLOTS: public Q_SLOTS:
/** /**
...@@ -398,7 +399,11 @@ CallModel::createCall(const QString& uri, bool isAudioOnly, VectorMapStringStrin ...@@ -398,7 +399,11 @@ CallModel::createCall(const QString& uri, bool isAudioOnly, VectorMapStringStrin
#endif // ENABLE_LIBWRAP #endif // ENABLE_LIBWRAP
if (callId.isEmpty()) { if (callId.isEmpty()) {
qDebug() << "no call placed between (account: " << owner.id << ", contact: " << uri << ")"; if (uri.startsWith("swarm:")) {
pimpl_->waitForConference_ = uri;
return {};
}
qWarning() << "no call placed between (account: " << owner.id << ", contact: " << uri << ")";
return ""; return "";
} }
...@@ -1735,6 +1740,10 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c ...@@ -1735,6 +1740,10 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c
QString currentCallId = currentCall_; QString currentCallId = currentCall_;
if (!conversationId.isEmpty()) { if (!conversationId.isEmpty()) {
Q_EMIT linked.callAddedToConference("", conversationId, confId); Q_EMIT linked.callAddedToConference("", conversationId, confId);
if (currentCall_ != confId && waitForConference_.contains(conversationId)) {
currentCall_ = confId;
Q_EMIT linked.currentCallChanged(confId);
}
} else { } else {
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId); QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
Q_FOREACH (const auto& call, callList) { Q_FOREACH (const auto& call, callList) {
......
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