diff options
author | Sebastian Stal <stal@pyboard.net> | 2013-08-07 09:53:52 -0700 |
---|---|---|
committer | Sebastian Stal <stal@pyboard.net> | 2013-08-07 09:53:52 -0700 |
commit | 105e2fa4a38de07493f9388ab23acba2b2969458 (patch) | |
tree | 54a86786e6cff98ae003f3e0f2f4f76d2f5bc7a3 /core/Messenger.h | |
parent | 39a213a58c8a98384b0813eb1e0f035606a7a305 (diff) |
Add read receipts using packet ID 65.
Diffstat (limited to 'core/Messenger.h')
-rw-r--r-- | core/Messenger.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/Messenger.h b/core/Messenger.h index 8940aadd..0e4eabe0 100644 --- a/core/Messenger.h +++ b/core/Messenger.h | |||
@@ -40,6 +40,7 @@ extern "C" { | |||
40 | 40 | ||
41 | #define PACKET_ID_NICKNAME 48 | 41 | #define PACKET_ID_NICKNAME 48 |
42 | #define PACKET_ID_USERSTATUS 49 | 42 | #define PACKET_ID_USERSTATUS 49 |
43 | #define PACKET_ID_RECEIPT 65 | ||
43 | #define PACKET_ID_MESSAGE 64 | 44 | #define PACKET_ID_MESSAGE 64 |
44 | 45 | ||
45 | /* status definitions */ | 46 | /* status definitions */ |
@@ -117,9 +118,14 @@ int m_delfriend(int friendnumber); | |||
117 | int m_friendstatus(int friendnumber); | 118 | int m_friendstatus(int friendnumber); |
118 | 119 | ||
119 | /* send a text chat message to an online friend | 120 | /* send a text chat message to an online friend |
120 | returns 1 if packet was successfully put into the send queue | 121 | returns the message id if packet was successfully put into the send queue |
121 | return 0 if it was not */ | 122 | return 0 if it was not |
122 | int m_sendmessage(int friendnumber, uint8_t *message, uint32_t length); | 123 | you will want to retain the return value, it will be passed to your read receipt callback |
124 | if one is received. | ||
125 | m_sendmessage_withid will send a message with the id of your choosing, | ||
126 | however we can generate an id for you by calling plain m_sendmessage. */ | ||
127 | uint32_t m_sendmessage(int friendnumber, uint8_t *message, uint32_t length); | ||
128 | uint32_t m_sendmessage_withid(int friendnumber, uint32_t theid, uint8_t *message, uint32_t length); | ||
123 | 129 | ||
124 | /* Set our nickname | 130 | /* Set our nickname |
125 | name must be a string of maximum MAX_NAME_LENGTH length. | 131 | name must be a string of maximum MAX_NAME_LENGTH length. |
@@ -183,6 +189,8 @@ void m_callback_namechange(void (*function)(int, uint8_t *, uint16_t)); | |||
183 | you are not responsible for freeing newstatus */ | 189 | you are not responsible for freeing newstatus */ |
184 | void m_callback_userstatus(void (*function)(int, USERSTATUS_KIND, uint8_t *, uint16_t)); | 190 | void m_callback_userstatus(void (*function)(int, USERSTATUS_KIND, uint8_t *, uint16_t)); |
185 | 191 | ||
192 | void m_callback_read_receipt(void (*function)(int, uint32_t)); | ||
193 | |||
186 | /* run this at startup | 194 | /* run this at startup |
187 | returns 0 if no connection problems | 195 | returns 0 if no connection problems |
188 | returns -1 if there are problems */ | 196 | returns -1 if there are problems */ |