diff options
Diffstat (limited to 'core/Messenger.c')
-rw-r--r-- | core/Messenger.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/Messenger.c b/core/Messenger.c index 57bc50e2..8236c117 100644 --- a/core/Messenger.c +++ b/core/Messenger.c | |||
@@ -42,10 +42,10 @@ typedef struct | |||
42 | 42 | ||
43 | #define MAX_NUM_FRIENDS 256 | 43 | #define MAX_NUM_FRIENDS 256 |
44 | 44 | ||
45 | Friend friendlist[MAX_NUM_FRIENDS]; | 45 | static Friend friendlist[MAX_NUM_FRIENDS]; |
46 | 46 | ||
47 | 47 | ||
48 | uint32_t numfriends; | 48 | static uint32_t numfriends; |
49 | 49 | ||
50 | 50 | ||
51 | //return the friend id associated to that public key. | 51 | //return the friend id associated to that public key. |
@@ -189,7 +189,7 @@ int m_sendmessage(int friendnumber, uint8_t * message, uint32_t length) | |||
189 | } | 189 | } |
190 | 190 | ||
191 | 191 | ||
192 | void (*friend_request)(uint8_t *, uint8_t *, uint16_t); | 192 | static void (*friend_request)(uint8_t *, uint8_t *, uint16_t); |
193 | 193 | ||
194 | //set the function that will be executed when a friend request is received. | 194 | //set the function that will be executed when a friend request is received. |
195 | void m_callback_friendrequest(void (*function)(uint8_t *, uint8_t *, uint16_t)) | 195 | void m_callback_friendrequest(void (*function)(uint8_t *, uint8_t *, uint16_t)) |
@@ -198,7 +198,7 @@ void m_callback_friendrequest(void (*function)(uint8_t *, uint8_t *, uint16_t)) | |||
198 | } | 198 | } |
199 | 199 | ||
200 | 200 | ||
201 | void (*friend_message)(int, uint8_t *, uint16_t); | 201 | static void (*friend_message)(int, uint8_t *, uint16_t); |
202 | 202 | ||
203 | //set the function that will be executed when a message from a friend is received. | 203 | //set the function that will be executed when a message from a friend is received. |
204 | void m_callback_friendmessage(void (*function)(int, uint8_t *, uint16_t)) | 204 | void m_callback_friendmessage(void (*function)(int, uint8_t *, uint16_t)) |
@@ -216,11 +216,10 @@ void initMessenger() | |||
216 | IP ip; | 216 | IP ip; |
217 | ip.i = 0; | 217 | ip.i = 0; |
218 | init_networking(ip, PORT); | 218 | init_networking(ip, PORT); |
219 | memcpy(self_client_id, self_public_key, crypto_box_PUBLICKEYBYTES); | ||
220 | 219 | ||
221 | } | 220 | } |
222 | 221 | ||
223 | void doFriends() | 222 | static void doFriends() |
224 | {//TODO: add incoming connections and some other stuff. | 223 | {//TODO: add incoming connections and some other stuff. |
225 | uint32_t i; | 224 | uint32_t i; |
226 | int len; | 225 | int len; |
@@ -280,7 +279,7 @@ void doFriends() | |||
280 | } | 279 | } |
281 | } | 280 | } |
282 | 281 | ||
283 | void doFriendRequest() | 282 | static void doFriendRequest() |
284 | { | 283 | { |
285 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; | 284 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; |
286 | uint8_t temp[MAX_DATA_SIZE]; | 285 | uint8_t temp[MAX_DATA_SIZE]; |
@@ -296,7 +295,7 @@ void doFriendRequest() | |||
296 | 295 | ||
297 | 296 | ||
298 | 297 | ||
299 | void doInbound() | 298 | static void doInbound() |
300 | { | 299 | { |
301 | uint8_t secret_nonce[crypto_box_NONCEBYTES]; | 300 | uint8_t secret_nonce[crypto_box_NONCEBYTES]; |
302 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; | 301 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; |