diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-13 18:31:51 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-14 16:16:30 +0000 |
commit | d8fcac5b4f66efcec961cf30cb461ab9231c6a67 (patch) | |
tree | 701cbb063b502c0cedeb87641bff39cc24a6bb8f /toxcore/friend_requests.h | |
parent | 4b54d14d9c35740140962942c48d964ee43b49ba (diff) |
Make Friend_Requests a module-private type.
Diffstat (limited to 'toxcore/friend_requests.h')
-rw-r--r-- | toxcore/friend_requests.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/toxcore/friend_requests.h b/toxcore/friend_requests.h index 316e1c67..e6948b6c 100644 --- a/toxcore/friend_requests.h +++ b/toxcore/friend_requests.h | |||
@@ -28,23 +28,7 @@ | |||
28 | 28 | ||
29 | #define MAX_FRIEND_REQUEST_DATA_SIZE (ONION_CLIENT_MAX_DATA_SIZE - (1 + sizeof(uint32_t))) | 29 | #define MAX_FRIEND_REQUEST_DATA_SIZE (ONION_CLIENT_MAX_DATA_SIZE - (1 + sizeof(uint32_t))) |
30 | 30 | ||
31 | typedef struct { | 31 | typedef struct Friend_Requests Friend_Requests; |
32 | uint32_t nospam; | ||
33 | void (*handle_friendrequest)(void *, const uint8_t *, const uint8_t *, size_t, void *); | ||
34 | uint8_t handle_friendrequest_isset; | ||
35 | void *handle_friendrequest_object; | ||
36 | |||
37 | int (*filter_function)(const uint8_t *, void *); | ||
38 | void *filter_function_userdata; | ||
39 | /* NOTE: The following is just a temporary fix for the multiple friend requests received at the same time problem. | ||
40 | * TODO(irungentoo): Make this better (This will most likely tie in with the way we will handle spam.) | ||
41 | */ | ||
42 | |||
43 | #define MAX_RECEIVED_STORED 32 | ||
44 | |||
45 | uint8_t received_requests[MAX_RECEIVED_STORED][CRYPTO_PUBLIC_KEY_SIZE]; | ||
46 | uint16_t received_requests_index; | ||
47 | } Friend_Requests; | ||
48 | 32 | ||
49 | /* Set and get the nospam variable used to prevent one type of friend request spam. */ | 33 | /* Set and get the nospam variable used to prevent one type of friend request spam. */ |
50 | void set_nospam(Friend_Requests *fr, uint32_t num); | 34 | void set_nospam(Friend_Requests *fr, uint32_t num); |
@@ -72,5 +56,7 @@ void set_filter_function(Friend_Requests *fr, int (*function)(const uint8_t *, v | |||
72 | /* Sets up friendreq packet handlers. */ | 56 | /* Sets up friendreq packet handlers. */ |
73 | void friendreq_init(Friend_Requests *fr, Friend_Connections *fr_c); | 57 | void friendreq_init(Friend_Requests *fr, Friend_Connections *fr_c); |
74 | 58 | ||
59 | Friend_Requests *friendreq_new(void); | ||
60 | void friendreq_kill(Friend_Requests *fr); | ||
75 | 61 | ||
76 | #endif | 62 | #endif |