Enable notifications by default if an interface doesn't require authentication

This commit is contained in:
Michael Zanetti 2017-09-08 15:51:58 +02:00
parent f68d47c5a8
commit ec5da8db07

View File

@ -446,11 +446,11 @@ void JsonRPCServer::registerHandler(JsonHandler *handler)
void JsonRPCServer::clientConnected(const QUuid &clientId)
{
// Notifications disabled by default. Clients must enable them with a valid token
m_clients.insert(clientId, false);
TransportInterface *interface = qobject_cast<TransportInterface *>(sender());
// If authentication is required, notifications are disabled by default. Clients must enable them with a valid token
m_clients.insert(clientId, !interface->configuration().authenticationEnabled);
QVariantMap handshake;
handshake.insert("id", 0);
handshake.insert("server", "guhIO");