diff --git a/src/mainview/components/OngoingCallPage.qml b/src/mainview/components/OngoingCallPage.qml index 8ecd59cd9a0a70bc41d3e9b8dac0711e3dee7db7..21a4808a607a7f8ca1afa95973c294fc43ac3cbf 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 aac5089ed5554d45c88cf7b0240fe5d01753574f..dc48bbe86389d86ea04170b2e583360ca932ce49 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<int>(interaction.type)); } catch (...) { } } diff --git a/src/messagesadapter.h b/src/messagesadapter.h index 350ad1dd7dbbeac38ffcaceccbc5d5329aaeee52..dd776098f6fa8c13a4278eb4e6a9ca561b6b46ee 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);