summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_contacts.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_contacts.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_contacts.cpp')
-rw-r--r--protocols/Tox/src/tox_contacts.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index 788105b0d4..1fd99bc36e 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -17,6 +17,26 @@ void CToxProto::SetAllContactsStatus(WORD status)
}
}
+MCONTACT CToxProto::GetContactFromAuthEvent(HANDLE hEvent)
+{
+ DWORD body[3];
+ DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
+ dbei.cbBlob = sizeof(DWORD)* 2;
+ dbei.pBlob = (PBYTE)&body;
+
+ if (::db_event_get(hEvent, &dbei))
+ return INVALID_CONTACT_ID;
+
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
+ return INVALID_CONTACT_ID;
+
+ if (strcmp(dbei.szModule, m_szModuleName) != 0)
+ return INVALID_CONTACT_ID;
+
+ return DbGetAuthEventContact(&dbei);
+}
+
+
bool CToxProto::IsProtoContact(MCONTACT hContact)
{
return lstrcmpiA(GetContactProto(hContact), m_szModuleName) == 0;