summaryrefslogtreecommitdiff
path: root/protocols/Tox/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-31 11:46:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-31 11:46:05 +0000
commit1ce3da1cca093143d9629bc46e221dd8be962e12 (patch)
treeb99d12d635a65f8c78499137137df2bd591b50be /protocols/Tox/src
parent03512ff2ed0f3d1ed6857ee85b0eb7268931ec3f (diff)
- MAllStrings: a handy union to hold an incoming string parameter of any type;
- FNAMECHAR: atavism extincted; - PROTOSEARCHRESULT: structure prepared to use results of any type, including utf git-svn-id: http://svn.miranda-ng.org/main/trunk@13932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r--protocols/Tox/src/tox_proto.cpp6
-rw-r--r--protocols/Tox/src/tox_search.cpp18
2 files changed, 12 insertions, 12 deletions
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index c9762e2360..7ec780634d 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -63,7 +63,7 @@ DWORD_PTR CToxProto::GetCaps(int type, MCONTACT)
MCONTACT CToxProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
{
- ptrA address(mir_t2a(psr->id));
+ ptrA address(mir_t2a(psr->id.t));
ptrA myAddress(getStringA(NULL, TOX_SETTINGS_ID));
if (strnicmp(address, myAddress, TOX_PUBLIC_KEY_SIZE) == 0)
{
@@ -75,8 +75,8 @@ MCONTACT CToxProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
ShowNotification(TranslateT("Contact already in your contact list"), 0, hContact);
return NULL;
}
- ptrT nick(mir_tstrdup(psr->nick));
- ptrT dnsId(mir_tstrdup(psr->email));
+ ptrT nick(mir_tstrdup(psr->nick.t));
+ ptrT dnsId(mir_tstrdup(psr->email.t));
return AddContact(address, nick, dnsId, flags & PALF_TEMPORARY);
}
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp
index 10f2fc68f5..96581e4d8d 100644
--- a/protocols/Tox/src/tox_search.cpp
+++ b/protocols/Tox/src/tox_search.cpp
@@ -88,12 +88,12 @@ void CToxProto::SearchByNameAsync(void *arg)
{
PROTOSEARCHRESULT psr = { sizeof(PROTOSEARCHRESULT) };
psr.flags = PSR_TCHAR;
- psr.id = mir_a2t(address);
- psr.nick = mir_utf8decodeT(name);
+ psr.id.t = mir_a2t(address);
+ psr.nick.t = mir_utf8decodeT(name);
TCHAR email[MAX_PATH];
- mir_sntprintf(email, SIZEOF(email), _T("%s@%s"), psr.nick, _A2T(dnsDomain));
- psr.email = mir_tstrdup(email);
+ mir_sntprintf(email, SIZEOF(email), _T("%s@%s"), psr.nick.t, _A2T(dnsDomain));
+ psr.email.t = mir_tstrdup(email);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
@@ -129,12 +129,12 @@ void CToxProto::SearchByNameAsync(void *arg)
{
PROTOSEARCHRESULT psr = { sizeof(PROTOSEARCHRESULT) };
psr.flags = PSR_TCHAR;
- psr.id = mir_utf8decodeT(address);
- psr.nick = mir_utf8decodeT(name);
+ psr.id.t = mir_utf8decodeT(address);
+ psr.nick.t = mir_utf8decodeT(name);
TCHAR email[MAX_PATH];
- mir_sntprintf(email, SIZEOF(email), _T("%s@%s"), psr.nick, _A2T(domain));
- psr.email = mir_tstrdup(email);
+ mir_sntprintf(email, SIZEOF(email), _T("%s@%s"), psr.nick.t, _A2T(domain));
+ psr.email.t = mir_tstrdup(email);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
break;
@@ -197,7 +197,7 @@ HWND CToxProto::OnSearchAdvanced(HWND owner)
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.id = mir_a2t(query.c_str());
+ psr.id.t = mir_a2t(query.c_str());
ADDCONTACTSTRUCT acs = { HANDLE_SEARCHRESULT };
acs.szProto = m_szModuleName;