From 8c4e9632602b62e7484fab3a741bbc1daa33c412 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 20 Aug 2014 18:08:33 +0000 Subject: Tox: - added own Tox ID in options dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@10243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/resource.h | Bin 2006 -> 1094 bytes protocols/Tox/src/tox_events.cpp | 2 +- protocols/Tox/src/tox_options.cpp | 19 +++++++++++++++++++ protocols/Tox/src/tox_proto.cpp | 8 +------- 4 files changed, 21 insertions(+), 8 deletions(-) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/resource.h b/protocols/Tox/src/resource.h index eceb7f7415..d78970c747 100644 Binary files a/protocols/Tox/src/resource.h and b/protocols/Tox/src/resource.h differ diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp index 51d2421629..ee439c8fdf 100644 --- a/protocols/Tox/src/tox_events.cpp +++ b/protocols/Tox/src/tox_events.cpp @@ -3,7 +3,7 @@ int CToxProto::OnAccountLoaded(WPARAM, LPARAM) { HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, this); - HookEventObj(ME_USERINFO_INITIALISE, OnUserInfoInit, this); + //HookEventObj(ME_USERINFO_INITIALISE, OnUserInfoInit, this); HookEventObj(ME_PROTO_ACCLISTCHANGED, OnAccountListChanged, this); InitNetlib(); diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index ddbed584a6..e048769ce1 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -15,6 +15,9 @@ INT_PTR CALLBACK CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, ptrW nick(proto->getTStringA("Nick")); SetDlgItemText(hwnd, IDC_NAME, nick); + ptrA toxId(proto->getStringA(TOX_SETTINGS_ID)); + SetDlgItemTextA(hwnd, IDC_TOXID, toxId); + ptrW group(proto->getTStringA(TOX_SETTINGS_GROUP)); SetDlgItemText(hwnd, IDC_GROUP, group); SendDlgItemMessage(hwnd, IDC_GROUP, EM_LIMITTEXT, 64, 0); @@ -36,6 +39,22 @@ INT_PTR CALLBACK CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, } break; + case IDC_CLIPBOARD: + { + char toxId[TOX_FRIEND_ADDRESS_SIZE * 2 + 1]; + GetDlgItemTextA(hwnd, IDC_TOXID, toxId, SIZEOF(toxId)); + if (OpenClipboard(GetDlgItem(hwnd, IDC_TOXID))) + { + EmptyClipboard(); + HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, SIZEOF(toxId)); + memcpy(GlobalLock(hMem), toxId, SIZEOF(toxId)); + GlobalUnlock(hMem); + SetClipboardData(CF_TEXT, hMem); + CloseClipboard(); + } + } + break; + case IDC_GROUP: if ((HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0; diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index ceee2bb544..1f618a5b58 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -151,13 +151,7 @@ int __cdecl CToxProto::RecvFile(MCONTACT hContact, PROTOFILEEVENT*) { return 0; int __cdecl CToxProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { - return (INT_PTR)AddDbEvent( - hContact, - EVENTTYPE_MESSAGE, - pre->timestamp, - DBEF_UTF, - lstrlenA(pre->szMessage), - (BYTE*)pre->szMessage); + return Proto_RecvMessage(hContact, pre); } int __cdecl CToxProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 0; } -- cgit v1.2.3