From aac8567528747e19ef86d4c80acc931112f2da2a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 22 Jun 2018 15:07:53 +0300 Subject: [PATCH] The way of obtaining IPv6 is changed. --- src/kernel/handler.cpp | 2 +- src/kernel/handler.hpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kernel/handler.cpp b/src/kernel/handler.cpp index 48db178..50f75b9 100644 --- a/src/kernel/handler.cpp +++ b/src/kernel/handler.cpp @@ -12,7 +12,7 @@ void Handler::handle(QJsonObject jsonReceived) QJsonObject jsonSend; if(jsonReceived["action"] == "createSession" && !jsonReceived.contains("status")) { - jsonSend["peerID"] = QHostAddress("fc8f:cc50:70b0:3731:d686:a75e:94f2:f44f").toString(); + jsonSend["peerID"] = my_ipv6; jsonSend["action"] = "createSession"; jsonSend["status"] = true; QString peerReceiver = jsonReceived["peerID"].toString(); diff --git a/src/kernel/handler.hpp b/src/kernel/handler.hpp index a81f0ae..f5588bc 100644 --- a/src/kernel/handler.hpp +++ b/src/kernel/handler.hpp @@ -7,6 +7,8 @@ class Handler : public QObject { Q_OBJECT + const QString my_ipv6 = Network::local_ipv6(); + public: Handler(); signals: @@ -15,4 +17,6 @@ class Handler : public QObject Network *network; private slots: void handle(QJsonObject jsonReceived); + + };