summaryrefslogtreecommitdiff
path: root/toxcore/friend_requests.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/friend_requests.c')
-rw-r--r--toxcore/friend_requests.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c
index c821d998..67977c23 100644
--- a/toxcore/friend_requests.c
+++ b/toxcore/friend_requests.c
@@ -26,6 +26,7 @@
26#endif 26#endif
27 27
28#include "friend_requests.h" 28#include "friend_requests.h"
29#include "util.h"
29 30
30/* Try to send a friend request to peer with public_key. 31/* Try to send a friend request to peer with public_key.
31 * data is the data in the request and length is the length. 32 * data is the data in the request and length is the length.
@@ -102,7 +103,7 @@ static void addto_receivedlist(Friend_Requests *fr, uint8_t *client_id)
102 if (fr->received_requests_index >= MAX_RECEIVED_STORED) 103 if (fr->received_requests_index >= MAX_RECEIVED_STORED)
103 fr->received_requests_index = 0; 104 fr->received_requests_index = 0;
104 105
105 memcpy(fr->received_requests[fr->received_requests_index], client_id, crypto_box_PUBLICKEYBYTES); 106 id_copy(fr->received_requests[fr->received_requests_index], client_id);
106 ++fr->received_requests_index; 107 ++fr->received_requests_index;
107} 108}
108 109
@@ -115,10 +116,9 @@ static int request_received(Friend_Requests *fr, uint8_t *client_id)
115{ 116{
116 uint32_t i; 117 uint32_t i;
117 118
118 for (i = 0; i < MAX_RECEIVED_STORED; ++i) { 119 for (i = 0; i < MAX_RECEIVED_STORED; ++i)
119 if (memcmp(fr->received_requests[i], client_id, crypto_box_PUBLICKEYBYTES) == 0) 120 if (id_equal(fr->received_requests[i], client_id))
120 return 1; 121 return 1;
121 }
122 122
123 return 0; 123 return 0;
124} 124}