diff options
Diffstat (limited to 'toxcore/friend_requests.c')
-rw-r--r-- | toxcore/friend_requests.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c index 987b1a4a..7574a881 100644 --- a/toxcore/friend_requests.c +++ b/toxcore/friend_requests.c | |||
@@ -72,11 +72,12 @@ uint32_t get_nospam(Friend_Requests *fr) | |||
72 | 72 | ||
73 | 73 | ||
74 | /* Set the function that will be executed when a friend request is received. */ | 74 | /* Set the function that will be executed when a friend request is received. */ |
75 | void callback_friendrequest(Friend_Requests *fr, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), | 75 | void callback_friendrequest(Friend_Requests *fr, void (*function)(void *, uint8_t *, uint8_t *, uint16_t, void *), |
76 | void *userdata) | 76 | void *object, void *userdata) |
77 | { | 77 | { |
78 | fr->handle_friendrequest = function; | 78 | fr->handle_friendrequest = function; |
79 | fr->handle_friendrequest_isset = 1; | 79 | fr->handle_friendrequest_isset = 1; |
80 | fr->handle_friendrequest_object = object; | ||
80 | fr->handle_friendrequest_userdata = userdata; | 81 | fr->handle_friendrequest_userdata = userdata; |
81 | } | 82 | } |
82 | /* Set the function used to check if a friend request should be displayed to the user or not. */ | 83 | /* Set the function used to check if a friend request should be displayed to the user or not. */ |
@@ -145,7 +146,8 @@ static int friendreq_handlepacket(void *object, uint8_t *source_pubkey, uint8_t | |||
145 | memcpy(message, packet + 4, length - 4); | 146 | memcpy(message, packet + 4, length - 4); |
146 | message[sizeof(message) - 1] = 0; /* Be sure the message is null terminated. */ | 147 | message[sizeof(message) - 1] = 0; /* Be sure the message is null terminated. */ |
147 | 148 | ||
148 | (*fr->handle_friendrequest)(source_pubkey, message, length - 4, fr->handle_friendrequest_userdata); | 149 | (*fr->handle_friendrequest)(fr->handle_friendrequest_object, source_pubkey, message, length - 4, |
150 | fr->handle_friendrequest_userdata); | ||
149 | return 0; | 151 | return 0; |
150 | } | 152 | } |
151 | 153 | ||