From 105e2fa4a38de07493f9388ab23acba2b2969458 Mon Sep 17 00:00:00 2001 From: Sebastian Stal Date: Wed, 7 Aug 2013 09:53:52 -0700 Subject: Add read receipts using packet ID 65. --- core/Messenger.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'core/Messenger.h') 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" { #define PACKET_ID_NICKNAME 48 #define PACKET_ID_USERSTATUS 49 +#define PACKET_ID_RECEIPT 65 #define PACKET_ID_MESSAGE 64 /* status definitions */ @@ -117,9 +118,14 @@ int m_delfriend(int friendnumber); int m_friendstatus(int friendnumber); /* send a text chat message to an online friend - returns 1 if packet was successfully put into the send queue - return 0 if it was not */ -int m_sendmessage(int friendnumber, uint8_t *message, uint32_t length); + returns the message id if packet was successfully put into the send queue + return 0 if it was not + you will want to retain the return value, it will be passed to your read receipt callback + if one is received. + m_sendmessage_withid will send a message with the id of your choosing, + however we can generate an id for you by calling plain m_sendmessage. */ +uint32_t m_sendmessage(int friendnumber, uint8_t *message, uint32_t length); +uint32_t m_sendmessage_withid(int friendnumber, uint32_t theid, uint8_t *message, uint32_t length); /* Set our nickname 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)); you are not responsible for freeing newstatus */ void m_callback_userstatus(void (*function)(int, USERSTATUS_KIND, uint8_t *, uint16_t)); +void m_callback_read_receipt(void (*function)(int, uint32_t)); + /* run this at startup returns 0 if no connection problems returns -1 if there are problems */ -- cgit v1.2.3