summaryrefslogtreecommitdiff
path: root/protocols/Tox/src
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-20 18:08:33 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-20 18:08:33 +0000
commit8c4e9632602b62e7484fab3a741bbc1daa33c412 (patch)
tree790981216251ae76f88725c7e01c2a5f3661f029 /protocols/Tox/src
parent65939a1b4d4ab134b3d040c70eb47f11d509a5f6 (diff)
Tox: - added own Tox ID in options dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@10243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r--protocols/Tox/src/resource.hbin2006 -> 1094 bytes
-rw-r--r--protocols/Tox/src/tox_events.cpp2
-rw-r--r--protocols/Tox/src/tox_options.cpp19
-rw-r--r--protocols/Tox/src/tox_proto.cpp8
4 files changed, 21 insertions, 8 deletions
diff --git a/protocols/Tox/src/resource.h b/protocols/Tox/src/resource.h
index eceb7f7415..d78970c747 100644
--- a/protocols/Tox/src/resource.h
+++ b/protocols/Tox/src/resource.h
Binary files 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; }