asd
This commit is contained in:
parent
926b6951f6
commit
5a630d6a23
5 changed files with 31 additions and 23 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <weechat/weechat-plugin.h>
|
||||
#include <tox/tox.h>
|
||||
|
||||
#include "tox-weechat.h"
|
||||
|
@ -58,6 +59,14 @@ tox_weechat_get_name_nt(int32_t friend_number)
|
|||
uint8_t name[length];
|
||||
tox_get_name(tox, friend_number, name);
|
||||
|
||||
// if no name, return client ID instead
|
||||
if (weechat_utf8_strlen((char *)name) == 0)
|
||||
{
|
||||
uint8_t client_id[TOX_CLIENT_ID_SIZE];
|
||||
tox_get_client_id(tox, friend_number, client_id);
|
||||
return tox_weechat_bin2hex(client_id, TOX_CLIENT_ID_SIZE);
|
||||
}
|
||||
|
||||
return tox_weechat_null_terminate(name, length);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue