From 571412f911326a988d0d84019ea6a4ee8b49b17d Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Thu, 10 Oct 2013 22:27:51 -0400 Subject: Added message ids to action messages --- toxcore/tox.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'toxcore/tox.c') diff --git a/toxcore/tox.c b/toxcore/tox.c index ded2da6d..8f4aef5b 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -132,7 +132,7 @@ int tox_friend_exists(Tox *tox, int friendnumber) * return 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 + * 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. @@ -150,15 +150,27 @@ uint32_t tox_sendmessage_withid(Tox *tox, int friendnumber, uint32_t theid, uint } /* Send an action to an online friend. - * return 1 if packet was successfully put into the send queue. + * + * return 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_sendaction_withid will send an action message with the id of your choosing, + * however we can generate an id for you by calling plain m_sendaction. */ -int tox_sendaction(Tox *tox, int friendnumber, uint8_t *action, uint32_t length) +uint32_t tox_sendaction(Tox *tox, int friendnumber, uint8_t *action, uint32_t length) { Messenger *m = tox; return m_sendaction(m, friendnumber, action, length); } +uint32_t tox_sendaction_withid(Tox *tox, int friendnumber, uint32_t theid, uint8_t *action, uint32_t length) +{ + Messenger *m = tox; + return m_sendaction_withid(m, friendnumber, theid, action, length); +} + /* Set friendnumber's nickname. * name must be a string of maximum MAX_NAME_LENGTH length. * length must be at least 1 byte. -- cgit v1.2.3