mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed the friends listing
This commit is contained in:
parent
84a0871cf6
commit
e920be4c01
|
@ -71,6 +71,12 @@ int getfriend_id(uint8_t *client_id)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Returns number of friends */
|
||||
int getnumfriends()
|
||||
{
|
||||
return numfriends;
|
||||
}
|
||||
|
||||
/* copies the public key associated to that friend id into client_id buffer.
|
||||
make sure that client_id is of size CLIENT_ID_SIZE.
|
||||
return 0 if success
|
||||
|
|
|
@ -137,11 +137,11 @@ void line_eval(char* line)
|
|||
}
|
||||
|
||||
else if (line[1] == 'l') {
|
||||
printf("\n[i] Friend List\n\n");
|
||||
printf("\n[i] Friend List - %d\n\n", getnumfriends());
|
||||
|
||||
int i;
|
||||
|
||||
for (i=0; i <= num_requests; i++) {
|
||||
for (i=0; i < getnumfriends(); i++) {
|
||||
char name[MAX_NAME_LENGTH];
|
||||
getname(i, (uint8_t*)name);
|
||||
printf("[%d] %s\n\n", i, (uint8_t*)name);
|
||||
|
|
Loading…
Reference in New Issue
Block a user