diff options
Diffstat (limited to 'protocols/Tox/src/tox_events.cpp')
-rw-r--r-- | protocols/Tox/src/tox_events.cpp | 37 |
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)
|