mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #33 from nurupo/master
Added conversion from friend_id to client_id
This commit is contained in:
commit
3a95d5da41
|
@ -66,6 +66,25 @@ int getfriend_id(uint8_t * client_id)
|
|||
return -1;
|
||||
}
|
||||
|
||||
//copies the public key associated to that friend id into client_id buffer.
|
||||
//make sure that client_id is of size CLIENT_ID_SIZE.
|
||||
//returns 0 if success
|
||||
//return -1 if failure.
|
||||
int getclient_id(int friend_id, uint8_t * client_id)
|
||||
{
|
||||
if(friendnumber >= numfriends || friendnumber < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(friendlist[friend_id].status > 0)
|
||||
{
|
||||
memcpy(client_id, friendlist[friend_id].client_id, CLIENT_ID_SIZE);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//add a friend
|
||||
//set the data that will be sent along with friend request
|
||||
|
|
|
@ -49,6 +49,12 @@ int m_addfriend_norequest(uint8_t * client_id);
|
|||
//return -1 if no such friend
|
||||
int getfriend_id(uint8_t * client_id);
|
||||
|
||||
//copies the public key associated to that friend id into client_id buffer.
|
||||
//make sure that client_id is of size CLIENT_ID_SIZE.
|
||||
//returns 0 if success
|
||||
//return -1 if failure.
|
||||
int getclient_id(int friend_id, uint8_t * client_id)
|
||||
|
||||
//remove a friend
|
||||
int m_delfriend(int friendnumber);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user