feat(src/components/notifier/Notifier): hide call notification when call is ended

This commit is contained in:
Ronan Abhamon 2017-02-09 15:23:15 +01:00
parent 2b5cb6bc64
commit 17877a8583

View file

@ -212,8 +212,17 @@ void Notifier::notifyReceivedCall (const shared_ptr<linphone::Call> &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<QQuickWindow *>()->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);