From 17877a85831480f2e49edcec20175e14041a9774 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 9 Feb 2017 15:23:15 +0100 Subject: [PATCH] feat(src/components/notifier/Notifier): hide call notification when call is ended --- linphone-desktop/src/components/notifier/Notifier.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linphone-desktop/src/components/notifier/Notifier.cpp b/linphone-desktop/src/components/notifier/Notifier.cpp index 2ef877033..a30c12a9d 100644 --- a/linphone-desktop/src/components/notifier/Notifier.cpp +++ b/linphone-desktop/src/components/notifier/Notifier.cpp @@ -212,8 +212,17 @@ void Notifier::notifyReceivedCall (const shared_ptr &call) { if (!notification) return; + CallModel *model = CoreManager::getInstance()->getCallsListModel()->getCall(call); + + QObject::connect( + model, &CallModel::statusChanged, notification, [notification](CallModel::CallStatus status) { + if (status == CallModel::CallStatusEnded) + notification->findChild()->setVisible(false); + } + ); + QVariantMap map; - map["call"].setValue(CoreManager::getInstance()->getCallsListModel()->getCall(call)); + map["call"].setValue(model); ::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, map); showNotification(notification, NOTIFICATION_TIMEOUT_RECEIVED_CALL);