summaryrefslogtreecommitdiff
path: root/core/Messenger.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/Messenger.h')
-rw-r--r--core/Messenger.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/Messenger.h b/core/Messenger.h
index 3044122b..55c86682 100644
--- a/core/Messenger.h
+++ b/core/Messenger.h
@@ -43,6 +43,7 @@ extern "C" {
43#define PACKET_ID_USERSTATUS 50 43#define PACKET_ID_USERSTATUS 50
44#define PACKET_ID_RECEIPT 65 44#define PACKET_ID_RECEIPT 65
45#define PACKET_ID_MESSAGE 64 45#define PACKET_ID_MESSAGE 64
46#define PACKET_ID_ACTION 63
46 47
47/* status definitions */ 48/* status definitions */
48#define FRIEND_ONLINE 4 49#define FRIEND_ONLINE 4
@@ -122,6 +123,11 @@ int m_friendstatus(int friendnumber);
122uint32_t m_sendmessage(int friendnumber, uint8_t *message, uint32_t length); 123uint32_t m_sendmessage(int friendnumber, uint8_t *message, uint32_t length);
123uint32_t m_sendmessage_withid(int friendnumber, uint32_t theid, uint8_t *message, uint32_t length); 124uint32_t m_sendmessage_withid(int friendnumber, uint32_t theid, uint8_t *message, uint32_t length);
124 125
126/* send an action to an online friend
127 returns 1 if packet was successfully put into the send queue
128 return 0 if it was not */
129int m_sendaction(int friendnumber, uint8_t *action, uint32_t length);
130
125/* Set our nickname 131/* Set our nickname
126 name must be a string of maximum MAX_NAME_LENGTH length. 132 name must be a string of maximum MAX_NAME_LENGTH length.
127 length must be at least 1 byte 133 length must be at least 1 byte
@@ -178,6 +184,10 @@ void m_callback_friendrequest(void (*function)(uint8_t *, uint8_t *, uint16_t));
178 function format is: function(int friendnumber, uint8_t * message, uint32_t length) */ 184 function format is: function(int friendnumber, uint8_t * message, uint32_t length) */
179void m_callback_friendmessage(void (*function)(int, uint8_t *, uint16_t)); 185void m_callback_friendmessage(void (*function)(int, uint8_t *, uint16_t));
180 186
187/* set the function that will be executed when an action from a friend is received.
188 function format is: function(int friendnumber, uint8_t * action, uint32_t length) */
189void m_callback_action(void (*function)(int, uint8_t *, uint16_t));
190
181/* set the callback for name changes 191/* set the callback for name changes
182 function(int friendnumber, uint8_t *newname, uint16_t length) 192 function(int friendnumber, uint8_t *newname, uint16_t length)
183 you are not responsible for freeing newname */ 193 you are not responsible for freeing newname */