diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-28 21:00:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-28 21:00:12 +0300 |
commit | 55e240d0dd36288af6cd195d95f567e0cba4180e (patch) | |
tree | 8159bb165c5b28e2eb99727c157dcdbe79b28269 | |
parent | 0c508d74bee722c4d0032b33377a1305b484027a (diff) |
ACKTYPE_GETINFO-related code cleaning
-rw-r--r-- | plugins/NewsAggregator/Src/Services.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/userinfo.cpp | 2 | ||||
-rw-r--r-- | protocols/Icq10/src/server.cpp | 11 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_iqid.cpp | 4 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime.cpp | 2 |
8 files changed, 18 insertions, 11 deletions
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 36993622b6..9589484662 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -119,7 +119,7 @@ INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM) static void __cdecl AckThreadProc(void *param)
{
Sleep(100);
- ProtoBroadcastAck(MODULENAME, (MCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(MODULENAME, (MCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1);
}
INT_PTR NewsAggrGetInfo(WPARAM, LPARAM lParam)
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 7e5505e0d7..c7202d55e9 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -473,7 +473,7 @@ void FacebookProto::RefreshUserInfo(void *data) ptrA user_id(getStringA(hContact, FACEBOOK_KEY_ID)); if (user_id == nullptr || isOffline()) { - ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)nullptr, 0); + ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, nullptr); return; } @@ -538,7 +538,7 @@ void FacebookProto::RefreshUserInfo(void *data) } } - ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)nullptr, 0); + ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, nullptr); } HANDLE FacebookProto::GetAwayMsg(MCONTACT) diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 0fa47ccedf..41ec9a9a9b 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -728,7 +728,7 @@ retry: }
debugLogA("mainthread() (%x): Setting user info for uin %d.", this, uin);
- ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1);
}
if (__nickname) mir_free(__nickname);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index ed1d995c65..fa628c2889 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -170,7 +170,7 @@ void __cdecl GaduProto::cmdgetinfothread(void *hContact) {
debugLogA("cmdgetinfothread(): started. Failed info retreival.");
gg_sleep(100, FALSE, "cmdgetinfothread", 103, 1);
- ProtoBroadcastAck((UINT_PTR)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
+ ProtoBroadcastAck((UINT_PTR)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1);
debugLogA("cmdgetinfothread(): end.");
}
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp index 1d93cab326..9a4a9be689 100644 --- a/protocols/IRCG/src/userinfo.cpp +++ b/protocols/IRCG/src/userinfo.cpp @@ -86,7 +86,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM SetDlgItemText(m_hwnd, IDC_HOST, dbv.pwszVal);
db_free(&dbv);
}
- ProtoBroadcastAck(p->ppro->m_szModuleName, p->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(p->ppro->m_szModuleName, p->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1);
}
break;
diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp index e7c49a7e04..7c5b8c6e0e 100644 --- a/protocols/Icq10/src/server.cpp +++ b/protocols/Icq10/src/server.cpp @@ -167,6 +167,7 @@ void CIcqProto::RetrieveUserInfo(MCONTACT hContact) { auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, ICQ_API_SERVER "/presence/get", &CIcqProto::OnGetUserInfo); pReq->flags |= NLHRF_NODUMPSEND; + pReq->pUserInfo = (void*)hContact; pReq << CHAR_PARAM("f", "json") << CHAR_PARAM("aimsid", m_aimsid) << INT_PARAM("mdir", 1) << INT_PARAM("t", getDword(hContact, "UIN")); Push(pReq); } @@ -315,15 +316,21 @@ void CIcqProto::OnCheckPassword(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*) StartSession(); } -void CIcqProto::OnGetUserInfo(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*) +void CIcqProto::OnGetUserInfo(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq) { + MCONTACT hContact = (MCONTACT)pReq->pUserInfo; + JsonReply root(pReply); - if (root.error() != 200) + if (root.error() != 200) { + ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, nullptr); return; + } const JSONNode &data = root.data(); for (auto &it : data["users"]) ParseBuddyInfo(it); + + ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, nullptr); } void CIcqProto::OnStartSession(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*) diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index b892d4b069..d34a7fa0ad 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -712,7 +712,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (!mir_wstrcmp(type, L"error")) {
if ((hContact = HContactFromJID(jid)) != 0)
- ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1);
return;
}
@@ -1148,7 +1148,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
else {
if ((hContact = HContactFromJID(jid)) != 0)
- ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1);
WindowList_Broadcast(m_hWindowList, WM_JABBER_REFRESH_VCARD, 0, 0);
}
}
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 15bbcd4357..ab7dce7818 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -115,7 +115,7 @@ void __cdecl sttFakeAckInfoSuccessThread(TFakeAckParams* tParam) proto->debugLogW(L"sttFakeAckInfoSuccessThread() start");
Sleep(100);
- proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1);
proto->debugLogW(L"sttFakeAckInfoSuccessThread() end");
mir_free(tParam);
|