summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-02-24 18:19:08 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-02-24 18:19:08 +0000
commit5abf533213e126786cb859be514656a9fb3a514f (patch)
treecb2f17ff68b538fab3d8d3f4b715d1a8703206ba /protocols/Tox/src/tox_contacts.cpp
parent0a0b962e6d597e8f2e3c88e5b43d01b786ebc314 (diff)
Tox: messages refactoring
git-svn-id: http://svn.miranda-ng.org/main/trunk@12261 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r--protocols/Tox/src/tox_contacts.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index 729cb056f6..4a5f15c7b2 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -97,6 +97,17 @@ MCONTACT CToxProto::AddContact(const char *address, const std::tstring &dnsId, b
return hContact;
}
+int32_t CToxProto::GetToxFriendNumber(MCONTACT hContact)
+{
+ ToxBinAddress pubKey = ptrA(getStringA(hContact, TOX_SETTINGS_ID));
+ int32_t friendNumber = tox_get_friend_number(tox, pubKey);
+ if (friendNumber == TOX_ERROR)
+ {
+ debugLogA("CToxProto::SendMsg: failed to get friend number");
+ }
+ return friendNumber;
+}
+
void CToxProto::LoadFriendList(void*)
{
uint32_t count = tox_count_friendlist(tox);