summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_proto.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-08-09 17:57:16 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-08-09 17:57:16 +0000
commitab807bf3e87863ef97412faf83dc2cac697d6a23 (patch)
tree74cb1861e535603e8fb5ef81da68714c653c3141 /protocols/Tox/src/tox_proto.cpp
parent681ba8556e859f38a0d7c910e9d40a9a917b3280 (diff)
use more nodes
git-svn-id: http://svn.miranda-ng.org/main/trunk@10138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_proto.cpp')
-rw-r--r--protocols/Tox/src/tox_proto.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index e2cc4f0407..b5bd446cb5 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -157,34 +157,27 @@ int __cdecl CToxProto::SetStatus(int iNewStatus)
char *name = "my_nickname";
int res = tox_set_name(tox, (uint8_t*)name, strlen(name));
- char *pub_key = HexToBinString(BOOTSTRAP_KEY);
- res = tox_bootstrap_from_address(tox, BOOTSTRAP_ADDRESS, 1, htons(BOOTSTRAP_PORT), (uint8_t *)pub_key);
- //mir_free(pub_key);
- if (!res)
- {
- SetStatus(ID_STATUS_OFFLINE);
- }
+ do_bootstrap(tox);
time_t timestamp0 = time(NULL);
int on = 0;
while (1) {
+ tox_do(tox);
+
if (on == 0) {
if (tox_isconnected(tox)) {
- //new_lines("[i] connected to DHT");
on = 1;
- mir_free(pub_key);
}
else {
time_t timestamp1 = time(NULL);
if (timestamp0 + 10 < timestamp1) {
timestamp0 = timestamp1;
- tox_bootstrap_from_address(tox, BOOTSTRAP_ADDRESS, 1, htons(BOOTSTRAP_PORT), (uint8_t *)pub_key);
+ do_bootstrap(tox);
}
}
}
- tox_do(tox);
}
res = tox_isconnected(tox);