summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_events.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-12 19:29:57 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-12 19:29:57 +0000
commit79f5521815e208cb694bbc814ee88429e20328b6 (patch)
tree62f552526e0626aa55285684f0fe12081a91349c /protocols/Tox/src/tox_events.cpp
parent4e5548a98703325099017bf6bf04b2fb5edefbd4 (diff)
Tox: getting friend request
git-svn-id: http://svn.miranda-ng.org/main/trunk@10170 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_events.cpp')
-rw-r--r--protocols/Tox/src/tox_events.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp
index c34e8078fb..ebc189aeba 100644
--- a/protocols/Tox/src/tox_events.cpp
+++ b/protocols/Tox/src/tox_events.cpp
@@ -42,6 +42,12 @@ int CToxProto::OnOptionsInit(void *obj, WPARAM wParam, LPARAM lParam)
void CToxProto::OnFriendRequest(Tox *tox, const uint8_t *userId, const uint8_t *message, const uint16_t messageSize, void *arg)
{
+ CToxProto *proto = (CToxProto*)arg;
+
+ std::vector<uint8_t> clientId(userId, userId + TOX_CLIENT_ID_SIZE);
+ std::string toxId = proto->DataToHexString(clientId);
+
+ proto->RaiseAuthRequestEvent(time(NULL), toxId.c_str(), (char*)message);
}
void CToxProto::OnFriendMessage(Tox *tox, const int friendnumber, const uint8_t *message, const uint16_t messageSize, void *arg)