summaryrefslogtreecommitdiff
path: root/toxcore/friend_requests.c
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-03-22 00:21:49 +0100
committermannol <eniz_vukovic@hotmail.com>2015-03-22 00:22:40 +0100
commita4fae8ffd49e298cd87e13be2496faf77e492bd9 (patch)
tree285ed6e22db90db713dc6938160d24e3857c6e5f /toxcore/friend_requests.c
parent4f76a8c89eea77ebc190a324ad128e3c7dda298c (diff)
parent4ad76497881ee2a623acdedcf0ac10406208b716 (diff)
Started testing transfer
Diffstat (limited to 'toxcore/friend_requests.c')
-rw-r--r--toxcore/friend_requests.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c
index 98937131..e4a10008 100644
--- a/toxcore/friend_requests.c
+++ b/toxcore/friend_requests.c
@@ -58,12 +58,12 @@ void set_filter_function(Friend_Requests *fr, int (*function)(const uint8_t *, v
58} 58}
59 59
60/* Add to list of received friend requests. */ 60/* Add to list of received friend requests. */
61static void addto_receivedlist(Friend_Requests *fr, const uint8_t *client_id) 61static void addto_receivedlist(Friend_Requests *fr, const uint8_t *real_pk)
62{ 62{
63 if (fr->received_requests_index >= MAX_RECEIVED_STORED) 63 if (fr->received_requests_index >= MAX_RECEIVED_STORED)
64 fr->received_requests_index = 0; 64 fr->received_requests_index = 0;
65 65
66 id_copy(fr->received_requests[fr->received_requests_index], client_id); 66 id_copy(fr->received_requests[fr->received_requests_index], real_pk);
67 ++fr->received_requests_index; 67 ++fr->received_requests_index;
68} 68}
69 69
@@ -72,28 +72,28 @@ static void addto_receivedlist(Friend_Requests *fr, const uint8_t *client_id)
72 * return 0 if it did not. 72 * return 0 if it did not.
73 * return 1 if it did. 73 * return 1 if it did.
74 */ 74 */
75static int request_received(Friend_Requests *fr, const uint8_t *client_id) 75static int request_received(Friend_Requests *fr, const uint8_t *real_pk)
76{ 76{
77 uint32_t i; 77 uint32_t i;
78 78
79 for (i = 0; i < MAX_RECEIVED_STORED; ++i) 79 for (i = 0; i < MAX_RECEIVED_STORED; ++i)
80 if (id_equal(fr->received_requests[i], client_id)) 80 if (id_equal(fr->received_requests[i], real_pk))
81 return 1; 81 return 1;
82 82
83 return 0; 83 return 0;
84} 84}
85 85
86/* Remove client id from received_requests list. 86/* Remove real pk from received_requests list.
87 * 87 *
88 * return 0 if it removed it successfully. 88 * return 0 if it removed it successfully.
89 * return -1 if it didn't find it. 89 * return -1 if it didn't find it.
90 */ 90 */
91int remove_request_received(Friend_Requests *fr, const uint8_t *client_id) 91int remove_request_received(Friend_Requests *fr, const uint8_t *real_pk)
92{ 92{
93 uint32_t i; 93 uint32_t i;
94 94
95 for (i = 0; i < MAX_RECEIVED_STORED; ++i) { 95 for (i = 0; i < MAX_RECEIVED_STORED; ++i) {
96 if (id_equal(fr->received_requests[i], client_id)) { 96 if (id_equal(fr->received_requests[i], real_pk)) {
97 memset(fr->received_requests[i], 0, crypto_box_PUBLICKEYBYTES); 97 memset(fr->received_requests[i], 0, crypto_box_PUBLICKEYBYTES);
98 return 0; 98 return 0;
99 } 99 }