summaryrefslogtreecommitdiff
path: root/toxcore/friend_requests.h
diff options
context:
space:
mode:
authorGregory Mullen (grayhatter) <greg@grayhatter.com>2016-08-22 14:44:58 -0700
committerGregory Mullen (grayhatter) <greg@grayhatter.com>2016-09-06 02:22:04 -0700
commitaad1e0ad3f96786e0fb10d8dd144e5e6ebe93258 (patch)
tree963477c57148626140286ac278369ef3af60811f /toxcore/friend_requests.h
parente7d3a1a665d1204d15b00fdbe6716b43d8ef3b4a (diff)
Make friend requests stateless
Messenger is slightly twisty when it comes to sending connection status callbacks It will very likely need at the very least a partial refactor to clean it up a bit. Toxcore shouldn't need void *userdata as deep as is currently does. (amend 1) Because of the nature of toxcore connection callbacks, I decided to change this commit from statelessness for connections changes to statelessness for friend requests. It's simpler this was and doesn't include doing anything foolish in the time between commits. group fixup because grayhatter doesn't want to do it "arguably correct" is not how you write security sensitive code Clear a compiler warning about types within a function.
Diffstat (limited to 'toxcore/friend_requests.h')
-rw-r--r--toxcore/friend_requests.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/toxcore/friend_requests.h b/toxcore/friend_requests.h
index ae21f7dc..5fd9bf34 100644
--- a/toxcore/friend_requests.h
+++ b/toxcore/friend_requests.h
@@ -33,7 +33,6 @@ typedef struct {
33 void (*handle_friendrequest)(void *, const uint8_t *, const uint8_t *, size_t, void *); 33 void (*handle_friendrequest)(void *, const uint8_t *, const uint8_t *, size_t, void *);
34 uint8_t handle_friendrequest_isset; 34 uint8_t handle_friendrequest_isset;
35 void *handle_friendrequest_object; 35 void *handle_friendrequest_object;
36 void *handle_friendrequest_userdata;
37 36
38 int (*filter_function)(const uint8_t *, void *); 37 int (*filter_function)(const uint8_t *, void *);
39 void *filter_function_userdata; 38 void *filter_function_userdata;
@@ -62,7 +61,7 @@ int remove_request_received(Friend_Requests *fr, const uint8_t *real_pk);
62 * Function format is function(uint8_t * public_key, uint8_t * data, size_t length, void * userdata) 61 * Function format is function(uint8_t * public_key, uint8_t * data, size_t length, void * userdata)
63 */ 62 */
64void callback_friendrequest(Friend_Requests *fr, void (*function)(void *, const uint8_t *, const uint8_t *, size_t, 63void callback_friendrequest(Friend_Requests *fr, void (*function)(void *, const uint8_t *, const uint8_t *, size_t,
65 void *), void *object, void *userdata); 64 void *), void *object);
66 65
67/* Set the function used to check if a friend request should be displayed to the user or not. 66/* Set the function used to check if a friend request should be displayed to the user or not.
68 * Function format is int function(uint8_t * public_key, void * userdata) 67 * Function format is int function(uint8_t * public_key, void * userdata)