Updated to new tox API. Fixed profile loading.
This commit is contained in:
@@ -57,9 +57,9 @@ twc_completion_friend(void *data,
|
||||
if (!profile)
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
uint32_t friend_count = tox_count_friendlist(profile->tox);
|
||||
int32_t *friend_numbers = malloc(sizeof(int32_t) * friend_count);
|
||||
tox_get_friendlist(profile->tox, friend_numbers, friend_count);
|
||||
uint32_t friend_count = tox_self_get_friend_list_size(profile->tox);
|
||||
uint32_t *friend_numbers = malloc(sizeof(uint32_t) * friend_count);
|
||||
tox_self_get_friend_list(profile->tox, friend_numbers);
|
||||
|
||||
for (uint32_t i = 0; i < friend_count; ++i)
|
||||
{
|
||||
@@ -68,7 +68,7 @@ twc_completion_friend(void *data,
|
||||
uint8_t tox_id[TOX_PUBLIC_KEY_SIZE];
|
||||
char hex_id[TOX_PUBLIC_KEY_SIZE * 2 + 1];
|
||||
|
||||
tox_get_client_id(profile->tox, friend_numbers[i], tox_id);
|
||||
tox_friend_get_public_key(profile->tox, friend_numbers[i], tox_id, NULL); // do error handling
|
||||
twc_bin2hex(tox_id, TOX_PUBLIC_KEY_SIZE, hex_id);
|
||||
|
||||
weechat_hook_completion_list_add(completion, hex_id, 0,
|
||||
|
||||
Reference in New Issue
Block a user