diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-10 13:21:25 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-10 13:21:25 +0000 |
commit | 75beae890b1f18d5753748f4935731ed93579ef8 (patch) | |
tree | 5cb0461034ec9b19db4b2d928caf79d6746b0974 /protocols/SkypeWeb/src/skype_search.cpp | |
parent | e0ec38eb49bfd8dcddd4e46cbbca4fed98028b01 (diff) |
flags fix
cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@13506 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_search.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_search.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/protocols/SkypeWeb/src/skype_search.cpp b/protocols/SkypeWeb/src/skype_search.cpp index 0d38e61fb1..4f5d48ab95 100644 --- a/protocols/SkypeWeb/src/skype_search.cpp +++ b/protocols/SkypeWeb/src/skype_search.cpp @@ -78,63 +78,63 @@ void CSkypeProto::OnSearch(const NETLIBHTTPREQUEST *response) /*JSONROOT pRoot;
JSONNODE *pResponse = CheckJsonResponse(pReq, reply, pRoot);
if (pResponse == NULL) {
- if (pParam) {
- mir_free(pParam->pszFirstName);
- mir_free(pParam->pszLastName);
- mir_free(pParam->pszNick);
- delete pParam;
- }
- ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
- return;
+ if (pParam) {
+ mir_free(pParam->pszFirstName);
+ mir_free(pParam->pszLastName);
+ mir_free(pParam->pszNick);
+ delete pParam;
+ }
+ ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ return;
}
int iCount = json_as_int(json_get(pResponse, "count"));
JSONNODE *pItems = json_get(pResponse, "items");
if (!pItems) {
- pItems = pResponse;
- iCount = 1;
- }
+ pItems = pResponse;
+ iCount = 1;
+ }
for (int i = 0; i<iCount; i++) {
- JSONNODE *pRecord = json_at(pItems, i);
- if (pRecord == NULL)
- break;
-
- PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ JSONNODE *pRecord = json_at(pItems, i);
+ if (pRecord == NULL)
+ break;
+
+ PROTOSEARCHRESULT psr = { sizeof(psr) };
+ psr.flags = PSR_TCHAR;
+
+ ptrT pId(json_as_string(json_get(pRecord, "id")));
+ ptrT pFirstName(json_as_string(json_get(pRecord, "first_name")));
+ ptrT pLastName(json_as_string(json_get(pRecord, "last_name")));
+ ptrT pNick(json_as_string(json_get(pRecord, "nickname")));
+ ptrT pDomain(json_as_string(json_get(pRecord, "domain")));
+
+ psr.id = mir_wstrdup(pId);
+ psr.firstName = mir_wstrdup(pFirstName);
+ psr.lastName = mir_wstrdup(pLastName);
+ psr.nick = mir_wstrdup(pNick);
+ if (!psr.nick || !psr.nick[0])
+ psr.nick = mir_wstrdup(pDomain);
+
+ 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;
+ }
- ptrT pId(json_as_string(json_get(pRecord, "id")));
- ptrT pFirstName(json_as_string(json_get(pRecord, "first_name")));
- ptrT pLastName(json_as_string(json_get(pRecord, "last_name")));
- ptrT pNick(json_as_string(json_get(pRecord, "nickname")));
- ptrT pDomain(json_as_string(json_get(pRecord, "domain")));
-
- psr.id = mir_wstrdup(pId);
- psr.firstName = mir_wstrdup(pFirstName);
- psr.lastName = mir_wstrdup(pLastName);
- psr.nick = mir_wstrdup(pNick);
- if (!psr.nick || !psr.nick[0])
- psr.nick = mir_wstrdup(pDomain);
-
- 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 (filter)
- ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
+ if (filter)
+ ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
}
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
if (pParam) {
- mir_free(pParam->pszFirstName);
- mir_free(pParam->pszLastName);
- mir_free(pParam->pszNick);
- delete pParam;
+ mir_free(pParam->pszFirstName);
+ mir_free(pParam->pszLastName);
+ mir_free(pParam->pszNick);
+ delete pParam;
}*/
}
\ No newline at end of file |