diff options
-rw-r--r-- | protocols/Tox/src/tox_core.cpp | 8 | ||||
-rw-r--r-- | protocols/Tox/src/tox_network.cpp | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp index 0cd6e045c3..f079917040 100644 --- a/protocols/Tox/src/tox_core.cpp +++ b/protocols/Tox/src/tox_core.cpp @@ -2,7 +2,7 @@ bool CToxProto::InitToxCore()
{
- debugLogA("CToxProto::InitToxCore: initializing tox profile");
+ debugLogA("CToxProto::InitToxCore: initializing tox core");
Tox_Options options = { 0 };
options.udp_disabled = getBool("DisableUDP", 0);
@@ -33,11 +33,15 @@ bool CToxProto::InitToxCore() }
}
+ debugLogA("CToxProto::InitToxCore: loading tox profile");
+
tox = tox_new(&options);
password = mir_utf8encodeW(ptrT(getTStringA("Password")));
bool isProfileLoaded = LoadToxProfile();
if (isProfileLoaded)
{
+ debugLogA("CToxProto::InitToxCore: tox profile load successfully");
+
tox_callback_friend_request(tox, OnFriendRequest, this);
tox_callback_friend_message(tox, OnFriendMessage, this);
tox_callback_friend_action(tox, OnFriendAction, this);
@@ -79,6 +83,8 @@ bool CToxProto::InitToxCore() }
else
{
+ debugLogA("CToxProto::InitToxCore: failed to load tox profile");
+
if (password != NULL)
{
mir_free(password);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index 71ec195ccb..a734d08ee7 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -7,6 +7,8 @@ bool CToxProto::IsOnline() void CToxProto::BootstrapDht()
{
+ debugLogA("CToxProto::BootstrapDht: bootstraping DHT");
+
bool isIPv4 = getBool("DisableIPv6", 0);
int nodeCount = db_get_w(NULL, MODULE, TOX_SETTINGS_NODE_COUNT, 0);
if (!nodeCount)
@@ -71,18 +73,20 @@ void CToxProto::CheckConnection(int &retriesCount) {
if (!isConnected)
{
+ debugLogA("CToxProto::CheckConnection: lost connection with DHT");
TryConnect();
}
else
{
if (tox_isconnected(tox))
{
+ debugLogA("CToxProto::CheckConnection: restored connection with DHT");
retriesCount = TOX_MAX_DISCONNECT_RETRIES;
}
else if (!(--retriesCount))
{
isConnected = false;
- debugLogA("CToxProto::PollingThread: disconnected from DHT");
+ debugLogA("CToxProto::CheckConnection: disconnected from DHT");
SetStatus(ID_STATUS_OFFLINE);
}
}
|