summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r--toxcore/Messenger.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index 75210830..d5ab6ee1 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -123,6 +123,18 @@ int getclient_id(const Messenger *m, int32_t friendnumber, uint8_t *client_id)
123 123
124 return -1; 124 return -1;
125} 125}
126
127/* return friend connection id on success.
128 * return -1 if failure.
129 */
130int getfriendcon_id(const Messenger *m, int32_t friendnumber)
131{
132 if (friend_not_valid(m, friendnumber))
133 return -1;
134
135 return m->friendlist[friendnumber].friendcon_id;
136}
137
126/* TODO: Another checksum algorithm might be better. 138/* TODO: Another checksum algorithm might be better.
127 * 139 *
128 * return a uint16_t that represents the checksum of address of length len. 140 * return a uint16_t that represents the checksum of address of length len.