summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_events.cpp
diff options
context:
space:
mode:
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)