diff --git a/src/gui/tray/notificationhandler.cpp b/src/gui/tray/notificationhandler.cpp index b429093ad7fd7..9a9e1893b9e45 100644 --- a/src/gui/tray/notificationhandler.cpp +++ b/src/gui/tray/notificationhandler.cpp @@ -150,9 +150,11 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j // Add another action to dismiss notification on server // https://github.com/owncloud/notifications/blob/master/docs/ocs-endpoint-v1.md#deleting-a-notification-for-a-user constexpr auto deleteVerb = "DELETE"; - if (std::find_if(std::cbegin(a._links), std::cend(a._links), [](const ActivityLink& link) { - return link._verb == deleteVerb; - }) == std::cend(a._links)) { + const auto itLink = std::find_if(std::cbegin(a._links), std::cend(a._links), [deleteVerb](const ActivityLink& link) { + Q_UNUSED(deleteVerb) + return link._verb == deleteVerb; + }); + if (itLink == std::cend(a._links)) { ActivityLink al; al._label = tr("Dismiss"); al._link = Utility::concatUrlPath(ai->account()->url(), notificationsPath + "/" + QString::number(a._id)).toString();