From 1ce3da1cca093143d9629bc46e221dd8be962e12 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 May 2015 11:46:05 +0000 Subject: - 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 --- protocols/VKontakte/src/vk_proto.cpp | 2 +- protocols/VKontakte/src/vk_search.cpp | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'protocols/VKontakte/src') diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index ae7bb7e818..62cbf1bf7b 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -502,7 +502,7 @@ MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT* psr) { debugLogA("CVkProto::AddToList"); - int uid = _ttoi(psr->id); + int uid = _ttoi(psr->id.t); if (!uid) return NULL; diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp index 2ba9be838b..1a07b0e28c 100644 --- a/protocols/VKontakte/src/vk_search.cpp +++ b/protocols/VKontakte/src/vk_search.cpp @@ -69,8 +69,8 @@ void CVkProto::SearchByMailThread(void* email) void __cdecl CVkProto::SearchThread(void* p) { PROTOSEARCHBYNAME *pParam = (PROTOSEARCHBYNAME *)p; - - TCHAR arg[200]; + + TCHAR arg[200]; mir_sntprintf(arg, SIZEOF(arg), _T("%s %s %s"), pParam->pszFirstName, pParam->pszNick, pParam->pszLastName); debugLog(_T("CVkProto::SearchThread %s"), arg); if (!IsOnline()) @@ -129,19 +129,19 @@ void CVkProto::OnSearch(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) CMString Nick(jnRecord["nickname"].as_mstring()); CMString Domain(jnRecord["domain"].as_mstring()); - psr.id = mir_tstrdup(Id); - psr.firstName = mir_tstrdup(FirstName); - psr.lastName = mir_tstrdup(LastName); - psr.nick = Nick.IsEmpty() ? mir_tstrdup(Domain) : mir_tstrdup(Nick); + psr.id.t = mir_tstrdup(Id); + psr.firstName.t = mir_tstrdup(FirstName); + psr.lastName.t = mir_tstrdup(LastName); + psr.nick.t = Nick.IsEmpty() ? mir_tstrdup(Domain) : mir_tstrdup(Nick); bool filter = true; if (pParam) { - if (psr.firstName && pParam->pszFirstName) - filter = tlstrstr(psr.firstName, pParam->pszFirstName) && filter; - if (psr.lastName && pParam->pszLastName) - filter = tlstrstr(psr.lastName, pParam->pszLastName) && filter; - if (psr.nick && pParam->pszNick) - filter = tlstrstr(psr.nick, pParam->pszNick) && filter; + if (psr.firstName.t && pParam->pszFirstName) + filter = tlstrstr(psr.firstName.t, pParam->pszFirstName) && filter; + if (psr.lastName.t && pParam->pszLastName) + filter = tlstrstr(psr.lastName.t, pParam->pszLastName) && filter; + if (psr.nick.t && pParam->pszNick) + filter = tlstrstr(psr.nick.t, pParam->pszNick) && filter; } if (filter) @@ -194,11 +194,11 @@ void CVkProto::OnSearchByMail(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) CMString Email(jnRecord["contact"].as_mstring()); - psr.id = mir_tstrdup(Id); - psr.firstName = mir_tstrdup(FirstName); - psr.lastName = mir_tstrdup(LastName); - psr.nick = Nick.IsEmpty() ? mir_tstrdup(Email) : mir_tstrdup(Nick); - psr.email = mir_tstrdup(Email); + psr.id.t = mir_tstrdup(Id); + psr.firstName.t = mir_tstrdup(FirstName); + psr.lastName.t = mir_tstrdup(LastName); + psr.nick.t = Nick.IsEmpty() ? mir_tstrdup(Email) : mir_tstrdup(Nick); + psr.email.t = mir_tstrdup(Email); ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr); } -- cgit v1.2.3