Tox is now shown as being online only when properly announced.

This commit is contained in:
irungentoo 2014-09-21 10:12:55 -04:00
parent fcc6d43cf2
commit f07c7d65b3
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
2 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -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. */