diff --git a/src/mainview/components/OngoingCallPage.qml b/src/mainview/components/OngoingCallPage.qml index 8ecd59cd..21a4808a 100644 --- a/src/mainview/components/OngoingCallPage.qml +++ b/src/mainview/components/OngoingCallPage.qml @@ -300,6 +300,12 @@ Rectangle { anchors.fill: parent + function toggleConversation() { + inCallMessageWebViewStack.visible ? + closeInCallConversation() : + openInCallConversation() + } + Connections { target: CallAdapter @@ -330,6 +336,16 @@ Rectangle { } } + Connections { + target: MessagesAdapter + + function onNewInteraction(interactionType) { + // Ignore call notifications, as we are in the call. + if (interactionType !== Interaction.Type.CALL && !inCallMessageWebViewStack.visible) + openInCallConversation() + } + } + onChatButtonClicked: { inCallMessageWebViewStack.visible ? closeInCallConversation() : diff --git a/src/messagesadapter.cpp b/src/messagesadapter.cpp index aac5089e..dc48bbe8 100644 --- a/src/messagesadapter.cpp +++ b/src/messagesadapter.cpp @@ -487,6 +487,7 @@ MessagesAdapter::newInteraction(const QString& accountId, auto& convModel = accountInfo.conversationModel; convModel->clearUnreadInteractions(convUid); printNewInteraction(*convModel, interactionId, interaction); + Q_EMIT newInteraction(static_cast(interaction.type)); } catch (...) { } } diff --git a/src/messagesadapter.h b/src/messagesadapter.h index 350ad1dd..dd776098 100644 --- a/src/messagesadapter.h +++ b/src/messagesadapter.h @@ -95,6 +95,7 @@ Q_SIGNALS: void contactBanned(); void navigateToWelcomePageRequested(); void invitationAccepted(); + void newInteraction(int type); public Q_SLOTS: void slotSendMessageContentSaved(const QString& content);