diff --git a/include/connectionmanager.h b/include/connectionmanager.h index ae08212c42ed89be9faf9eadc3c18f96c06f1949..b03c345fe8666c6e89da42050b52e96dce72bb7c 100644 --- a/include/connectionmanager.h +++ b/include/connectionmanager.h @@ -221,7 +221,8 @@ public: * Note: The connections are represented as maps with string keys and string values. The map * contains the following key-value pairs: * - "id": The unique identifier of the connection. - * - "userUri": The user URI associated with the connection (if available). + * - "peer": The contact URI associated with the connection (if available). + * - "device": The device URI associated with the connection. * - "status": The status of the connection, represented as an integer: * - 0: ConnectionStatus::Connected * - 1: ConnectionStatus::TLS diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp index 9fda75c4472f212e0290f2080e92f26e80b4a1b4..9134bd9b65e9d0d587fdf8f28119e3b813dda8cf 100644 --- a/src/connectionmanager.cpp +++ b/src/connectionmanager.cpp @@ -1783,9 +1783,11 @@ ConnectionManager::getConnectionList(const DeviceId& device) const continue; std::map<std::string, std::string> connectionInfo; connectionInfo["id"] = callbackIdToString(key.first, key.second); - if (ci->tls_ && ci->tls_->peerCertificate()) { - auto cert = ci->tls_->peerCertificate(); - connectionInfo["userUri"] = cert->issuer->getId().toString(); + connectionInfo["device"] = key.first; + if (ci->tls_) { + if (auto cert = ci->tls_->peerCertificate()) { + connectionInfo["peer"] = cert->issuer->getId().toString(); + } } if (ci->socket_) { connectionInfo["status"] = std::to_string(static_cast<int>(ConnectionStatus::Connected));