diff options
author | pete <petewicken@gmail.com> | 2013-08-29 22:17:51 +0100 |
---|---|---|
committer | pete <petewicken@gmail.com> | 2013-08-29 22:17:51 +0100 |
commit | 82b8927af7f68bbfbf83bbb5ffbc747de7bc288f (patch) | |
tree | ba83cda597e8146c0d02128fb8424bec9201d730 /toxcore/friend_requests.h | |
parent | 792709e4e091ea587a642c548889ddbb866e9b5e (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.h | 21 |
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. |
51 | int 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 | */ |
53 | int 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. */ | ||
55 | void set_nospam(Friend_Requests *fr, uint32_t num); | 55 | void set_nospam(Friend_Requests *fr, uint32_t num); |
56 | uint32_t get_nospam(Friend_Requests *fr); | 56 | uint32_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 | */ | ||
60 | void callback_friendrequest(Friend_Requests *fr, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), | 61 | void 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. */ |
64 | void friendreq_init(Friend_Requests *fr, Net_Crypto *c); | 65 | void friendreq_init(Friend_Requests *fr, Net_Crypto *c); |
65 | 66 | ||
66 | #ifdef __cplusplus | 67 | #ifdef __cplusplus |