diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-09-30 19:00:16 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-09-30 19:00:16 +0000 |
commit | 559624af12bf19b4bc925cf3f95c6fbd809cc4fb (patch) | |
tree | ad4a42e9c28d2efef7dbeb41ea78b74592a94cb3 /protocols/Tox/src/tox_search.cpp | |
parent | f3132fe11d470b5a852c04f464cc0e7efcf391a6 (diff) |
Tox:
- utf8 support in search window
- try to hide tox id
git-svn-id: http://svn.miranda-ng.org/main/trunk@10654 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_search.cpp')
-rw-r--r-- | protocols/Tox/src/tox_search.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index 22cf2e78f9..8e1df68786 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -48,10 +48,10 @@ void CToxProto::SearchByNameAsync(void *arg) PROTOSEARCHRESULT psr = { sizeof(PROTOSEARCHRESULT) };
psr.flags = PSR_TCHAR;
psr.id = mir_a2t(id.c_str());
- psr.nick = mir_a2t(name);
+ psr.nick = mir_utf8decodeT(name);
TCHAR email[MAX_PATH];
- mir_sntprintf(email, SIZEOF(email), _T("%s@%s"), _A2T(name), _A2T(server->domain));
+ mir_sntprintf(email, SIZEOF(email), _T("%s@%s"), psr.nick, _A2T(server->domain));
psr.email = mir_tstrdup(email);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
@@ -108,10 +108,10 @@ HWND __cdecl CToxProto::SearchAdvanced(HWND owner) std::smatch match;
std::regex regex("^\\s*([A-Fa-f0-9]{76})\\s*$");
- char text[TOX_FRIEND_ADDRESS_SIZE * 2 + 1];
- GetDlgItemTextA(owner, IDC_SEARCH, text, SIZEOF(text));
+ TCHAR text[MAX_PATH];
+ GetDlgItemText(owner, IDC_SEARCH, text, SIZEOF(text));
- const std::string query = text;
+ const std::string query = ptrA(mir_utf8encodeT(text));
if (std::regex_search(query, match, regex))
{
std::string address = match[1];
|