summaryrefslogtreecommitdiff
path: root/toxcore/friend_requests.h
diff options
context:
space:
mode:
authorpete <petewicken@gmail.com>2013-08-29 22:17:51 +0100
committerpete <petewicken@gmail.com>2013-08-29 22:17:51 +0100
commit82b8927af7f68bbfbf83bbb5ffbc747de7bc288f (patch)
treeba83cda597e8146c0d02128fb8424bec9201d730 /toxcore/friend_requests.h
parent792709e4e091ea587a642c548889ddbb866e9b5e (diff)
Correct a lot of the grammar and spelling. Also spent a few hours fixing the comments so they follow a standard.
Diffstat (limited to 'toxcore/friend_requests.h')
-rw-r--r--toxcore/friend_requests.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/toxcore/friend_requests.h b/toxcore/friend_requests.h
index 2ebd557b..58572488 100644
--- a/toxcore/friend_requests.h
+++ b/toxcore/friend_requests.h
@@ -37,8 +37,9 @@ typedef struct {
37 uint8_t handle_friendrequest_isset; 37 uint8_t handle_friendrequest_isset;
38 void *handle_friendrequest_userdata; 38 void *handle_friendrequest_userdata;
39 39
40 /*NOTE: the following is just a temporary fix for the multiple friend requests received at the same time problem 40/* NOTE: The following is just a temporary fix for the multiple friend requests received at the same time problem.
41 TODO: Make this better (This will most likely tie in with the way we will handle spam.)*/ 41 * TODO: Make this better (This will most likely tie in with the way we will handle spam.)
42 */
42 43
43#define MAX_RECEIVED_STORED 32 44#define MAX_RECEIVED_STORED 32
44 45
@@ -46,21 +47,21 @@ typedef struct {
46 uint16_t received_requests_index; 47 uint16_t received_requests_index;
47} Friend_Requests; 48} Friend_Requests;
48 49
49/* Try to send a friendrequest to peer with public_key 50/* Try to send a friendrequest to peer with public_key.
50 data is the data in the request and length is the length. */ 51 * data is the data in the request and length is the length.
51int send_friendrequest(DHT *dht, uint8_t *public_key, uint32_t nospam_num, uint8_t *data, uint32_t length);
52/*
53 * Set and get the nospam variable used to prevent one type of friend request spam
54 */ 52 */
53int send_friendrequest(DHT *dht, uint8_t *public_key, uint32_t nospam_num, uint8_t *data, uint32_t length);
54/* Set and get the nospam variable used to prevent one type of friend request spam. */
55void set_nospam(Friend_Requests *fr, uint32_t num); 55void set_nospam(Friend_Requests *fr, uint32_t num);
56uint32_t get_nospam(Friend_Requests *fr); 56uint32_t get_nospam(Friend_Requests *fr);
57 57
58/* set the function that will be executed when a friend request for us is received. 58/* Set the function that will be executed when a friend request for us is received.
59 function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) */ 59 * Function format is function(uint8_t * public_key, uint8_t * data, uint16_t length)
60 */
60void callback_friendrequest(Friend_Requests *fr, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), 61void callback_friendrequest(Friend_Requests *fr, void (*function)(uint8_t *, uint8_t *, uint16_t, void *),
61 void *userdata); 62 void *userdata);
62 63
63/* sets up friendreq packet handlers */ 64/* Sets up friendreq packet handlers. */
64void friendreq_init(Friend_Requests *fr, Net_Crypto *c); 65void friendreq_init(Friend_Requests *fr, Net_Crypto *c);
65 66
66#ifdef __cplusplus 67#ifdef __cplusplus