diff --git a/libnymea-core/jsonrpc/jsonrpcserverimplementation.cpp b/libnymea-core/jsonrpc/jsonrpcserverimplementation.cpp index 9484c71d..46b505fa 100644 --- a/libnymea-core/jsonrpc/jsonrpcserverimplementation.cpp +++ b/libnymea-core/jsonrpc/jsonrpcserverimplementation.cpp @@ -744,14 +744,6 @@ void JsonRPCServerImplementation::sendNotification(const QVariantMap ¶ms) notification.insert("id", m_notificationId++); notification.insert("notification", handler->name() + "." + method.name()); - // Add deprecation warning if necessary - if (m_api.value("notifications").toMap().value(handler->name() + '.' + method.name()).toMap().contains("deprecated")) { - QString deprecationMessage = m_api.value("notifications").toMap().value(handler->name() + '.' + method.name()).toMap().value("deprecated").toString(); - qCWarning(dcJsonRpc()) << "Client uses deprecated API. Please update client implementation!"; - qCWarning(dcJsonRpc()) << handler->name() + '.' + method.name() + ':' << deprecationMessage; - notification.insert("deprecationWarning", deprecationMessage); - } - foreach (const QUuid &clientId, m_clientNotifications.keys()) { // Check if this client wants to be notified @@ -759,6 +751,14 @@ void JsonRPCServerImplementation::sendNotification(const QVariantMap ¶ms) continue; } + // Add deprecation warning if necessary + if (m_api.value("notifications").toMap().value(handler->name() + '.' + method.name()).toMap().contains("deprecated")) { + QString deprecationMessage = m_api.value("notifications").toMap().value(handler->name() + '.' + method.name()).toMap().value("deprecated").toString(); + qCWarning(dcJsonRpc()) << "Client" << clientId << "uses deprecated API. Please update client implementation!"; + qCWarning(dcJsonRpc()) << handler->name() + '.' + method.name() + ':' << deprecationMessage; + notification.insert("deprecationWarning", deprecationMessage); + } + QLocale locale = m_clientLocales.value(clientId); QVariantMap translatedParams = handler->translateNotification(method.name(), params, locale);