summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_events.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-18 21:02:24 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-18 21:02:24 +0000
commita93391bc7442c024d5e795e207b8422883e7bfdf (patch)
tree62226bdafa41fd80ab7122fd8ed67fbb71a29ef5 /protocols/Tox/src/tox_events.cpp
parente39da35942db7d2bd7c192336f4d3c33e44d0ba4 (diff)
Tox:
- save our id in database - first approach of user info support git-svn-id: http://svn.miranda-ng.org/main/trunk@10233 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_events.cpp')
-rw-r--r--protocols/Tox/src/tox_events.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp
index 38f6d1d493..cef4bb7cc2 100644
--- a/protocols/Tox/src/tox_events.cpp
+++ b/protocols/Tox/src/tox_events.cpp
@@ -3,6 +3,7 @@
int CToxProto::OnAccountLoaded(WPARAM, LPARAM)
{
HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, this);
+ HookEventObj(ME_USERINFO_INITIALISE, OnUserInfoInit, this);
HookEventObj(ME_PROTO_ACCLISTCHANGED, OnAccountListChanged, this);
InitNetlib();
@@ -70,6 +71,42 @@ int CToxProto::OnOptionsInit(void *obj, WPARAM wParam, LPARAM)
return 0;
}
+int CToxProto::OnUserInfoInit(void *obj, WPARAM wParam, LPARAM hContact)
+{
+ return 0;
+
+ CToxProto *proto = (CToxProto*)obj;
+
+ if ((!proto->IsProtoContact(hContact) && hContact))
+ return 0;
+
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.flags = ODPF_TCHAR | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
+ odp.hInstance = g_hInstance;
+ odp.dwInitParam = (LPARAM)obj;
+ odp.position = -1900000000;
+ odp.ptszTitle = proto->m_tszUserName;
+
+ if (hContact)
+ {
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0);
+ if (szProto != NULL && !strcmp(szProto, proto->m_szModuleName)) {
+ //odp.pfnDlgProc = SkypeDlgProc;
+ //odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SKYPE);
+ UserInfo_AddPage(wParam, &odp);
+ }
+ }
+ else
+ {
+ //odp.pfnDlgProc = ContactSkypeDlgProc;
+ //odp.pszTemplate = MAKEINTRESOURCEA(IDD_OWNINFO_CONTACT);
+ odp.ptszTab = LPGENT("Contacts");
+ UserInfo_AddPage(wParam, &odp);
+ }
+
+ return 0;
+}
+
int CToxProto::OnContactDeleted(MCONTACT hContact, LPARAM lParam)
{
if (hContact)