summaryrefslogtreecommitdiff
path: root/core/Messenger.c
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2013-07-13 17:44:43 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2013-07-13 18:09:17 -0400
commitc2fb803ad5d3fdfeebd3fa2d61cb2cc3d68d2930 (patch)
tree7ee5f682fc5130bebc757d8d7650bc19fb4e0329 /core/Messenger.c
parentd63d63de9b17afaa5896929d00fbc1ba04e52491 (diff)
Added conversion from friend_id to client_id
Diffstat (limited to 'core/Messenger.c')
-rw-r--r--core/Messenger.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/Messenger.c b/core/Messenger.c
index 8236c117..65a73876 100644
--- a/core/Messenger.c
+++ b/core/Messenger.c
@@ -66,6 +66,25 @@ int getfriend_id(uint8_t * client_id)
66 return -1; 66 return -1;
67} 67}
68 68
69//copies the public key associated to that friend id into client_id buffer.
70//make sure that client_id is of size CLIENT_ID_SIZE.
71//returns 0 if success
72//return -1 if failure.
73int getclient_id(int friend_id, uint8_t * client_id)
74{
75 if(friendnumber >= numfriends || friendnumber < 0)
76 {
77 return -1;
78 }
79
80 if(friendlist[friend_id].status > 0)
81 {
82 memcpy(client_id, friendlist[friend_id].client_id, CLIENT_ID_SIZE);
83 return 0;
84 }
85 return -1;
86}
87
69 88
70//add a friend 89//add a friend
71//set the data that will be sent along with friend request 90//set the data that will be sent along with friend request