From f07c7d65b3d9e06fccc987ecb35207939601aa92 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sun, 21 Sep 2014 10:12:55 -0400 Subject: [PATCH] Tox is now shown as being online only when properly announced. --- toxcore/onion_client.c | 3 ++- toxcore/tox.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index ab7958c6a..3b1306026 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -1340,7 +1340,8 @@ int onion_isconnected(const Onion_Client *onion_c) for (i = 0; i < MAX_ONION_CLIENTS; ++i) { if (!is_timeout(onion_c->clients_announce_list[i].timestamp, ONION_NODE_TIMEOUT)) - return 1; + if (onion_c->clients_announce_list[i].is_stored) + return 1; } return 0; diff --git a/toxcore/tox.c b/toxcore/tox.c index c1851f062..a4413c4f7 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -809,6 +809,7 @@ int tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8_ { Messenger *m = tox; IP_Port ip_port, ip_port_v4; + if (!addr_parse_ip(address, &ip_port.ip)) { if (m->options.udp_disabled) /* Disable DNS when udp is disabled. */ return 0; @@ -837,6 +838,7 @@ int tox_bootstrap_from_address(Tox *tox, const char *address, uint16_t port, con { Messenger *m = tox; int ret = tox_add_tcp_relay(tox, address, port, public_key); + if (m->options.udp_disabled) { return ret; } else { /* DHT only works on UDP. */