diff options
author | irungentoo <irungentoo@gmail.com> | 2013-10-23 14:32:09 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-10-23 14:32:09 -0400 |
commit | a67b4f8c6d85b5d77cbd8b04a1f7a90a4470947b (patch) | |
tree | c3cac91476290c4400d65d0eae0d510966ae5939 /toxcore/Messenger.c | |
parent | b515eac0a3bec4d111e759922fd206236b56b4b1 (diff) |
Code cleanups.
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 2e8efeac..eb379c4c 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -714,7 +714,7 @@ IP_Port get_friend_ipport(Messenger *m, int friendnumber) | |||
714 | 714 | ||
715 | int crypt_id = m->friendlist[friendnumber].crypt_connection_id; | 715 | int crypt_id = m->friendlist[friendnumber].crypt_connection_id; |
716 | 716 | ||
717 | if (is_cryptoconnected(m->net_crypto, crypt_id) != 3) | 717 | if (is_cryptoconnected(m->net_crypto, crypt_id) != CRYPTO_CONN_ESTABLISHED) |
718 | return zero; | 718 | return zero; |
719 | 719 | ||
720 | return connection_ip(m->net_crypto->lossless_udp, m->net_crypto->crypto_connections[crypt_id].number); | 720 | return connection_ip(m->net_crypto->lossless_udp, m->net_crypto->crypto_connections[crypt_id].number); |
@@ -1454,13 +1454,13 @@ void doFriends(Messenger *m) | |||
1454 | int friendok = DHT_getfriendip(m->dht, m->friendlist[i].client_id, &friendip); | 1454 | int friendok = DHT_getfriendip(m->dht, m->friendlist[i].client_id, &friendip); |
1455 | 1455 | ||
1456 | switch (is_cryptoconnected(m->net_crypto, m->friendlist[i].crypt_connection_id)) { | 1456 | switch (is_cryptoconnected(m->net_crypto, m->friendlist[i].crypt_connection_id)) { |
1457 | case 0: | 1457 | case CRYPTO_CONN_NO_CONNECTION: |
1458 | if (friendok == 1) | 1458 | if (friendok == 1) |
1459 | m->friendlist[i].crypt_connection_id = crypto_connect(m->net_crypto, m->friendlist[i].client_id, friendip); | 1459 | m->friendlist[i].crypt_connection_id = crypto_connect(m->net_crypto, m->friendlist[i].client_id, friendip); |
1460 | 1460 | ||
1461 | break; | 1461 | break; |
1462 | 1462 | ||
1463 | case 3: /* Connection is established. */ | 1463 | case CRYPTO_CONN_ESTABLISHED: /* Connection is established. */ |
1464 | set_friend_status(m, i, FRIEND_ONLINE); | 1464 | set_friend_status(m, i, FRIEND_ONLINE); |
1465 | m->friendlist[i].name_sent = 0; | 1465 | m->friendlist[i].name_sent = 0; |
1466 | m->friendlist[i].userstatus_sent = 0; | 1466 | m->friendlist[i].userstatus_sent = 0; |
@@ -1468,7 +1468,7 @@ void doFriends(Messenger *m) | |||
1468 | m->friendlist[i].ping_lastrecv = temp_time; | 1468 | m->friendlist[i].ping_lastrecv = temp_time; |
1469 | break; | 1469 | break; |
1470 | 1470 | ||
1471 | case 4: | 1471 | case CRYPTO_CONN_TIMED_OUT: |
1472 | crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id); | 1472 | crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id); |
1473 | m->friendlist[i].crypt_connection_id = -1; | 1473 | m->friendlist[i].crypt_connection_id = -1; |
1474 | break; | 1474 | break; |
@@ -1706,7 +1706,7 @@ void doFriends(Messenger *m) | |||
1706 | } | 1706 | } |
1707 | } else { | 1707 | } else { |
1708 | if (is_cryptoconnected(m->net_crypto, | 1708 | if (is_cryptoconnected(m->net_crypto, |
1709 | m->friendlist[i].crypt_connection_id) == 4) { /* If the connection timed out, kill it. */ | 1709 | m->friendlist[i].crypt_connection_id) == CRYPTO_CONN_TIMED_OUT) { /* If the connection timed out, kill it. */ |
1710 | crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id); | 1710 | crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id); |
1711 | m->friendlist[i].crypt_connection_id = -1; | 1711 | m->friendlist[i].crypt_connection_id = -1; |
1712 | set_friend_status(m, i, FRIEND_CONFIRMED); | 1712 | set_friend_status(m, i, FRIEND_CONFIRMED); |