summaryrefslogtreecommitdiff
path: root/toxcore/tox.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-10-11 06:42:07 -0700
committerirungentoo <irungentoo@gmail.com>2013-10-11 06:42:07 -0700
commit31f5d7a8abacd045de1d55a0462d17d14095073c (patch)
tree31e93f067cf7f89b00d650f8f8fd7ba0fd640efb /toxcore/tox.c
parent77ec51085828c8dbe764030cbae7242994e590de (diff)
parent571412f911326a988d0d84019ea6a4ee8b49b17d (diff)
Merge pull request #618 from nurupo/action-messages-with-id
Added message ids to action messages
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r--toxcore/tox.c18
1 files changed, 15 insertions, 3 deletions
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)
132 * return the message id if packet was successfully put into the send queue. 132 * return the message id if packet was successfully put into the send queue.
133 * return 0 if it was not. 133 * return 0 if it was not.
134 * 134 *
135 * You will want to retain the return value, it will be passed to your read receipt callback 135 * You will want to retain the return value, it will be passed to your read_receipt callback
136 * if one is received. 136 * if one is received.
137 * m_sendmessage_withid will send a message with the id of your choosing, 137 * m_sendmessage_withid will send a message with the id of your choosing,
138 * however we can generate an id for you by calling plain m_sendmessage. 138 * 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
150} 150}
151 151
152/* Send an action to an online friend. 152/* Send an action to an online friend.
153 * return 1 if packet was successfully put into the send queue. 153 *
154 * return the message id if packet was successfully put into the send queue.
154 * return 0 if it was not. 155 * return 0 if it was not.
156 *
157 * You will want to retain the return value, it will be passed to your read_receipt callback
158 * if one is received.
159 * m_sendaction_withid will send an action message with the id of your choosing,
160 * however we can generate an id for you by calling plain m_sendaction.
155 */ 161 */
156int tox_sendaction(Tox *tox, int friendnumber, uint8_t *action, uint32_t length) 162uint32_t tox_sendaction(Tox *tox, int friendnumber, uint8_t *action, uint32_t length)
157{ 163{
158 Messenger *m = tox; 164 Messenger *m = tox;
159 return m_sendaction(m, friendnumber, action, length); 165 return m_sendaction(m, friendnumber, action, length);
160} 166}
161 167
168uint32_t tox_sendaction_withid(Tox *tox, int friendnumber, uint32_t theid, uint8_t *action, uint32_t length)
169{
170 Messenger *m = tox;
171 return m_sendaction_withid(m, friendnumber, theid, action, length);
172}
173
162/* Set friendnumber's nickname. 174/* Set friendnumber's nickname.
163 * name must be a string of maximum MAX_NAME_LENGTH length. 175 * name must be a string of maximum MAX_NAME_LENGTH length.
164 * length must be at least 1 byte. 176 * length must be at least 1 byte.