summaryrefslogtreecommitdiff
path: root/core/friend_requests.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/friend_requests.c')
-rw-r--r--core/friend_requests.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/core/friend_requests.c b/core/friend_requests.c
index 18f0866b..d24dd4b4 100644
--- a/core/friend_requests.c
+++ b/core/friend_requests.c
@@ -2,13 +2,29 @@
2 * 2 *
3 * Handle friend requests. 3 * Handle friend requests.
4 * 4 *
5 * Copyright (C) 2013 Tox project All Rights Reserved.
6 *
7 * This file is part of Tox.
8 *
9 * Tox is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * Tox is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
21 *
5 */ 22 */
6 23
7#include "friend_requests.h" 24#include "friend_requests.h"
8 25
9uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; 26uint8_t self_public_key[crypto_box_PUBLICKEYBYTES];
10 27
11
12/* Try to send a friendrequest to peer with public_key 28/* Try to send a friendrequest to peer with public_key
13 data is the data in the request and length is the length. 29 data is the data in the request and length is the length.
14 return -1 if failure. 30 return -1 if failure.
@@ -44,7 +60,6 @@ int send_friendrequest(uint8_t * public_key, uint8_t * data, uint32_t length)
44 return num; 60 return num;
45} 61}
46 62
47
48static void (*handle_friendrequest)(uint8_t *, uint8_t *, uint16_t); 63static void (*handle_friendrequest)(uint8_t *, uint8_t *, uint16_t);
49static uint8_t handle_friendrequest_isset = 0; 64static uint8_t handle_friendrequest_isset = 0;
50 65
@@ -55,7 +70,6 @@ void callback_friendrequest(void (*function)(uint8_t *, uint8_t *, uint16_t))
55 handle_friendrequest_isset = 1; 70 handle_friendrequest_isset = 1;
56} 71}
57 72
58
59int friendreq_handlepacket(uint8_t * packet, uint32_t length, IP_Port source) 73int friendreq_handlepacket(uint8_t * packet, uint32_t length, IP_Port source)
60{ 74{
61 75