summaryrefslogtreecommitdiff
path: root/toxcore/tox.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-09-12 20:29:30 -0400
committerirungentoo <irungentoo@gmail.com>2013-09-12 20:29:30 -0400
commitf8b979a92a8c316c49bed28e158a468a2f74346c (patch)
treedd139feb11dde83d1f16cc7be9f92c3d8e680dd1 /toxcore/tox.h
parent41b162eb189d3631abba4c65ced3570c776e45a5 (diff)
Put group chat functions in the public API.
Group chats are not complete, they seem to work very well though. This means that the functions will change.
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r--toxcore/tox.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h
index 811e798b..6d5db49f 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -289,6 +289,59 @@ void tox_callback_read_receipt(Tox *tox, void (*function)(Tox *tox, int, uint32_
289 */ 289 */
290void tox_callback_connectionstatus(Tox *tox, void (*function)(Tox *tox, int, uint8_t, void *), void *userdata); 290void tox_callback_connectionstatus(Tox *tox, void (*function)(Tox *tox, int, uint8_t, void *), void *userdata);
291 291
292/**********GROUP CHAT FUNCTIONS: WARNING WILL BREAK A LOT************/
293
294/* Set the callback for group invites.
295 *
296 * Function(Tox *tox, int friendnumber, uint8_t *group_public_key, void *userdata)
297 */
298void tox_callback_group_invite(Tox *tox, void (*function)(Tox *tox, int, uint8_t *, void *), void *userdata);
299
300/* Set the callback for group messages.
301 *
302 * Function(Tox *tox, int groupnumber, uint8_t * message, uint16_t length, void *userdata)
303 */
304void tox_callback_group_message(Tox *tox, void (*function)(Tox *tox, int, uint8_t *, uint16_t, void *),
305 void *userdata);
306
307/* Creates a new groupchat and puts it in the chats array.
308 *
309 * return group number on success.
310 * return -1 on failure.
311 */
312int tox_add_groupchat(Tox *tox);
313
314/* Delete a groupchat from the chats array.
315 *
316 * return 0 on success.
317 * return -1 if failure.
318 */
319int tox_del_groupchat(Tox *tox, int groupnumber);
320
321/* invite friendnumber to groupnumber
322 * return 0 on success
323 * return -1 on failure
324 */
325int tox_invite_friend(Tox *tox, int friendnumber, int groupnumber);
326
327/* Join a group (you need to have been invited first.)
328 *
329 * returns group number on success
330 * returns -1 on failure.
331 */
332int tox_join_groupchat(Tox *tox, int friendnumber, uint8_t *friend_group_public_key);
333
334
335/* send a group message
336 * return 0 on success
337 * return -1 on failure
338 */
339int tox_group_message_send(Tox *tox, int groupnumber, uint8_t *message, uint32_t length);
340
341
342
343/******************END OF GROUP CHAT FUNCTIONS************************/
344
292/* Use this function to bootstrap the client. 345/* Use this function to bootstrap the client.
293 * Sends a get nodes request to the given node with ip port and public_key. 346 * Sends a get nodes request to the given node with ip port and public_key.
294 */ 347 */