From b9455efd8430d3578376400f986e62223f1504b3 Mon Sep 17 00:00:00 2001 From: Jin^eLD Date: Thu, 5 Sep 2013 00:45:36 +0300 Subject: Function for retreiving a list of friend numbers This should allow clients to sync the Tox friend list with their UI/etc. lists. --- toxcore/tox.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'toxcore/tox.c') diff --git a/toxcore/tox.c b/toxcore/tox.c index 23ca6572..e55f51ca 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -247,6 +247,17 @@ void tox_set_sends_receipts(void *tox, int friendnumber, int yesno) m_set_sends_receipts(m, friendnumber, yesno); } +/* Allocate and return a list of valid friend id's. List must be freed by the + * caller. + * + * retun 0 if success. + * return -1 if failure. + */ +int tox_get_friendlist(void *tox, int **out_list, uint32_t *out_list_length) +{ + Messenger *m = tox; + return get_friendlist(m, out_list, out_list_length); +} /* Set the function that will be executed when a friend request is received. * Function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) -- cgit v1.2.3