summaryrefslogtreecommitdiff
path: root/core/Messenger.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-06 22:28:15 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-06 22:28:15 -0400
commit2528ec148c6b1865a489c232800377f1d3952f04 (patch)
tree7479f63fc65eb56336d2619c7205046577580d72 /core/Messenger.h
parent6a9805d368c56e68e3220dc8a68bcd213f327d90 (diff)
Very basic start on the Tox messaging api.(Should give you a basic idea how it's gonna work)
Diffstat (limited to 'core/Messenger.h')
-rw-r--r--core/Messenger.h48
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.
18int m_addfriend(uint8_t * client_id);
19
20
21//remove a friend
22int m_delfriend(int friendnumber);
23
24//return 1 if friend is online
25//return 0 if he is not
26int m_friendonline(int friendnumber);
27
28
29//send a text chat message to a friend.
30int m_sendmessage(int friendnumber);
31
32
33//set the function that will be executed when a friend request is recieved.
34int m_callback_friendrequest();
35
36
37//set the function that will be executed when a message from a friend is recieved.
38int m_callback_friendmessage();
39
40
41//run this at startup
42void initMessenger();
43
44
45//the main loop that needs to be run at least 200 times per second.
46void doMessenger();
47
48#endif