diff options
Diffstat (limited to 'core/Messenger.h')
-rw-r--r-- | core/Messenger.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/core/Messenger.h b/core/Messenger.h new file mode 100644 index 00000000..ae8ace16 --- /dev/null +++ b/core/Messenger.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* Messenger.h | ||
2 | * | ||
3 | * An implementation of a simple text chat only messenger on the tox network core. | ||
4 | * | ||
5 | */ | ||
6 | |||
7 | |||
8 | #ifndef MESSENGER_H | ||
9 | #define MESSENGER_H | ||
10 | |||
11 | #include "net_crypto.h" | ||
12 | #include "DHT.h" | ||
13 | |||
14 | |||
15 | //add a friend | ||
16 | //returns the friend number if success | ||
17 | //return -1 if failure. | ||
18 | int m_addfriend(uint8_t * client_id); | ||
19 | |||
20 | |||
21 | //remove a friend | ||
22 | int m_delfriend(int friendnumber); | ||
23 | |||
24 | //return 1 if friend is online | ||
25 | //return 0 if he is not | ||
26 | int m_friendonline(int friendnumber); | ||
27 | |||
28 | |||
29 | //send a text chat message to a friend. | ||
30 | int m_sendmessage(int friendnumber); | ||
31 | |||
32 | |||
33 | //set the function that will be executed when a friend request is recieved. | ||
34 | int m_callback_friendrequest(); | ||
35 | |||
36 | |||
37 | //set the function that will be executed when a message from a friend is recieved. | ||
38 | int m_callback_friendmessage(); | ||
39 | |||
40 | |||
41 | //run this at startup | ||
42 | void initMessenger(); | ||
43 | |||
44 | |||
45 | //the main loop that needs to be run at least 200 times per second. | ||
46 | void doMessenger(); | ||
47 | |||
48 | #endif | ||