diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-29 17:55:58 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-29 17:55:58 -0400 |
commit | ea994606fe4ee57f2d6ac1ddfb2225f8a1aacef0 (patch) | |
tree | 4c7f407486c8780ceaf68bbf17f7266027ed9d05 /toxcore/friend_requests.h | |
parent | 85940f94b2560f87988da8e793eb8998c5b77ead (diff) | |
parent | 82b8927af7f68bbfbf83bbb5ffbc747de7bc288f (diff) |
Merge branch 'master' of https://github.com/JamoBox/ProjectTox-Core into JamoBox-master
Conflicts:
toxcore/LAN_discovery.h
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 f4cbf67d..b5c46056 100644 --- a/toxcore/friend_requests.h +++ b/toxcore/friend_requests.h | |||
@@ -34,8 +34,9 @@ typedef struct { | |||
34 | uint8_t handle_friendrequest_isset; | 34 | uint8_t handle_friendrequest_isset; |
35 | void *handle_friendrequest_userdata; | 35 | void *handle_friendrequest_userdata; |
36 | 36 | ||
37 | /*NOTE: the following is just a temporary fix for the multiple friend requests received at the same time problem | 37 | /* NOTE: The following is just a temporary fix for the multiple friend requests received at the same time problem. |
38 | TODO: Make this better (This will most likely tie in with the way we will handle spam.)*/ | 38 | * TODO: Make this better (This will most likely tie in with the way we will handle spam.) |
39 | */ | ||
39 | 40 | ||
40 | #define MAX_RECEIVED_STORED 32 | 41 | #define MAX_RECEIVED_STORED 32 |
41 | 42 | ||
@@ -43,21 +44,21 @@ typedef struct { | |||
43 | uint16_t received_requests_index; | 44 | uint16_t received_requests_index; |
44 | } Friend_Requests; | 45 | } Friend_Requests; |
45 | 46 | ||
46 | /* Try to send a friendrequest to peer with public_key | 47 | /* Try to send a friendrequest to peer with public_key. |
47 | data is the data in the request and length is the length. */ | 48 | * data is the data in the request and length is the length. |
48 | int send_friendrequest(DHT *dht, uint8_t *public_key, uint32_t nospam_num, uint8_t *data, uint32_t length); | ||
49 | /* | ||
50 | * Set and get the nospam variable used to prevent one type of friend request spam | ||
51 | */ | 49 | */ |
50 | int send_friendrequest(DHT *dht, uint8_t *public_key, uint32_t nospam_num, uint8_t *data, uint32_t length); | ||
51 | /* Set and get the nospam variable used to prevent one type of friend request spam. */ | ||
52 | void set_nospam(Friend_Requests *fr, uint32_t num); | 52 | void set_nospam(Friend_Requests *fr, uint32_t num); |
53 | uint32_t get_nospam(Friend_Requests *fr); | 53 | uint32_t get_nospam(Friend_Requests *fr); |
54 | 54 | ||
55 | /* set the function that will be executed when a friend request for us is received. | 55 | /* Set the function that will be executed when a friend request for us is received. |
56 | function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) */ | 56 | * Function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) |
57 | */ | ||
57 | void callback_friendrequest(Friend_Requests *fr, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), | 58 | void callback_friendrequest(Friend_Requests *fr, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), |
58 | void *userdata); | 59 | void *userdata); |
59 | 60 | ||
60 | /* sets up friendreq packet handlers */ | 61 | /* Sets up friendreq packet handlers. */ |
61 | void friendreq_init(Friend_Requests *fr, Net_Crypto *c); | 62 | void friendreq_init(Friend_Requests *fr, Net_Crypto *c); |
62 | 63 | ||
63 | 64 | ||