summaryrefslogtreecommitdiff
path: root/toxcore/tox.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r--toxcore/tox.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c
index 6bb20c81..554414b1 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -278,21 +278,22 @@ TOX_CONNECTION tox_get_connection_status(const Tox *tox)
278{ 278{
279 const Messenger *m = tox; 279 const Messenger *m = tox;
280 280
281 if (onion_isconnected(m->onion_c)) { 281 unsigned int ret = onion_connection_status(m->onion_c);
282 if (DHT_non_lan_connected(m->dht)) {
283 return TOX_CONNECTION_UDP;
284 }
285 282
283 if (ret == 2) {
284 return TOX_CONNECTION_UDP;
285 } else if (ret == 1) {
286 return TOX_CONNECTION_TCP; 286 return TOX_CONNECTION_TCP;
287 } else {
288 return TOX_CONNECTION_NONE;
287 } 289 }
288
289 return TOX_CONNECTION_NONE;
290} 290}
291 291
292 292
293void tox_callback_connection_status(Tox *tox, tox_connection_status_cb *function, void *user_data) 293void tox_callback_connection_status(Tox *tox, tox_connection_status_cb *function, void *user_data)
294{ 294{
295 //TODO 295 Messenger *m = tox;
296 m_callback_core_connection(m, function, user_data);
296} 297}
297 298
298uint32_t tox_iteration_interval(const Tox *tox) 299uint32_t tox_iteration_interval(const Tox *tox)