mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Tox is now shown as being online only when properly announced.
This commit is contained in:
parent
fcc6d43cf2
commit
f07c7d65b3
|
@ -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;
|
||||
|
|
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue
Block a user