From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IcqOscarJ/src/UI/askauthentication.cpp | 4 +- protocols/IcqOscarJ/src/UI/userinfotab.cpp | 6 +- protocols/IcqOscarJ/src/capabilities.cpp | 12 +- protocols/IcqOscarJ/src/cookies.cpp | 12 +- protocols/IcqOscarJ/src/cookies.h | 6 +- protocols/IcqOscarJ/src/directpackets.cpp | 12 +- protocols/IcqOscarJ/src/fam_01service.cpp | 6 +- protocols/IcqOscarJ/src/fam_02location.cpp | 8 +- protocols/IcqOscarJ/src/fam_03buddy.cpp | 10 +- protocols/IcqOscarJ/src/fam_04message.cpp | 52 ++-- protocols/IcqOscarJ/src/fam_09bos.cpp | 2 +- protocols/IcqOscarJ/src/fam_13servclist.cpp | 36 +-- protocols/IcqOscarJ/src/fam_15icqserver.cpp | 12 +- protocols/IcqOscarJ/src/icq_avatar.cpp | 12 +- protocols/IcqOscarJ/src/icq_avatar.h | 8 +- protocols/IcqOscarJ/src/icq_clients.cpp | 2 +- protocols/IcqOscarJ/src/icq_db.cpp | 36 +-- protocols/IcqOscarJ/src/icq_direct.cpp | 16 +- protocols/IcqOscarJ/src/icq_direct.h | 4 +- protocols/IcqOscarJ/src/icq_directmsg.cpp | 4 +- protocols/IcqOscarJ/src/icq_filerequests.cpp | 8 +- protocols/IcqOscarJ/src/icq_infoupdate.cpp | 4 +- protocols/IcqOscarJ/src/icq_menu.cpp | 20 +- protocols/IcqOscarJ/src/icq_popups.cpp | 2 +- protocols/IcqOscarJ/src/icq_proto.cpp | 54 ++-- protocols/IcqOscarJ/src/icq_proto.h | 318 +++++++++++------------ protocols/IcqOscarJ/src/icq_rates.h | 2 +- protocols/IcqOscarJ/src/icq_server.cpp | 2 +- protocols/IcqOscarJ/src/icq_servlist.cpp | 64 ++--- protocols/IcqOscarJ/src/icq_servlist.h | 6 +- protocols/IcqOscarJ/src/icq_uploadui.cpp | 14 +- protocols/IcqOscarJ/src/icq_xstatus.cpp | 22 +- protocols/IcqOscarJ/src/icq_xtraz.cpp | 14 +- protocols/IcqOscarJ/src/icqosc_svcs.cpp | 26 +- protocols/IcqOscarJ/src/oscar_filetransfer.cpp | 18 +- protocols/IcqOscarJ/src/oscar_filetransfer.h | 4 +- protocols/IcqOscarJ/src/stdpackets.cpp | 26 +- protocols/IcqOscarJ/src/utilities.cpp | 90 +++---- protocols/IcqOscarJ/src/utilities.h | 10 +- 39 files changed, 482 insertions(+), 482 deletions(-) (limited to 'protocols/IcqOscarJ') diff --git a/protocols/IcqOscarJ/src/UI/askauthentication.cpp b/protocols/IcqOscarJ/src/UI/askauthentication.cpp index 76e290f704..91fe8e75d2 100644 --- a/protocols/IcqOscarJ/src/UI/askauthentication.cpp +++ b/protocols/IcqOscarJ/src/UI/askauthentication.cpp @@ -32,7 +32,7 @@ struct AskAuthParam { CIcqProto* ppro; - HCONTACT hContact; + MCONTACT hContact; }; static INT_PTR CALLBACK AskAuthProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -90,7 +90,7 @@ static INT_PTR CALLBACK AskAuthProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA INT_PTR CIcqProto::RequestAuthorization(WPARAM wParam, LPARAM lParam) { - AskAuthParam param = { this, (HCONTACT)wParam }; + AskAuthParam param = { this, (MCONTACT)wParam }; DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ASKAUTH), NULL, AskAuthProc, (LPARAM)¶m); return 0; } diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp index 1c0bcb67f4..793aa0d04d 100644 --- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/UI/userinfotab.cpp @@ -41,7 +41,7 @@ extern const char *nameXStatus[]; ///////////////////////////////////////////////////////////////////////////////////////// -static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, HCONTACT hContact, char* szModule, char* szSetting, int special) +static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContact, char* szModule, char* szSetting, int special) { DBVARIANT dbv = {0}; char str[MAX_PATH]; @@ -221,7 +221,7 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break; char* szProto; - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact == NULL) szProto = ppro->m_szModuleName; @@ -284,7 +284,7 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) { - if ((!IsICQContact((HCONTACT)lParam)) && lParam) + if ((!IsICQContact((MCONTACT)lParam)) && lParam) return 0; OPTIONSDIALOGPAGE odp = { sizeof(odp) }; diff --git a/protocols/IcqOscarJ/src/capabilities.cpp b/protocols/IcqOscarJ/src/capabilities.cpp index 91e464b561..8a61dc9f44 100644 --- a/protocols/IcqOscarJ/src/capabilities.cpp +++ b/protocols/IcqOscarJ/src/capabilities.cpp @@ -102,14 +102,14 @@ void NetLog_CapabilityChange(CIcqProto *ppro, const char *szChange, DWORD fdwCap // Deletes all oscar capabilities for a given contact -void CIcqProto::ClearAllContactCapabilities(HCONTACT hContact) +void CIcqProto::ClearAllContactCapabilities(MCONTACT hContact) { setDword(hContact, DBSETTING_CAPABILITIES, 0); } // Deletes one or many oscar capabilities for a given contact -void CIcqProto::ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) +void CIcqProto::ClearContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -129,7 +129,7 @@ void CIcqProto::ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilitie // Sets one or many oscar capabilities for a given contact -void CIcqProto::SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) +void CIcqProto::SetContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -149,7 +149,7 @@ void CIcqProto::SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) // Returns true if the given contact supports the requested capabilites -BOOL CIcqProto::CheckContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) +BOOL CIcqProto::CheckContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -218,7 +218,7 @@ DWORD GetCapabilitiesFromBuffer(BYTE *pBuffer, int nLength) // Scans a binary buffer for oscar capabilities and adds them to the contact. // You probably want to call ClearAllContactCapabilities() first. -void CIcqProto::AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength) +void CIcqProto::AddCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -241,7 +241,7 @@ void CIcqProto::AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int // Scans a binary buffer for oscar capabilities and adds them to the contact. // You probably want to call ClearAllContactCapabilities() first. -void CIcqProto::SetCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset) +void CIcqProto::SetCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset) { // Get current capability flags DWORD fdwContactCaps = bReset ? 0 : getDword(hContact, DBSETTING_CAPABILITIES, 0); diff --git a/protocols/IcqOscarJ/src/cookies.cpp b/protocols/IcqOscarJ/src/cookies.cpp index f5e7999a77..1419a8f398 100644 --- a/protocols/IcqOscarJ/src/cookies.cpp +++ b/protocols/IcqOscarJ/src/cookies.cpp @@ -50,7 +50,7 @@ void CIcqProto::RemoveExpiredCookies() // Generate and allocate cookie -DWORD CIcqProto::AllocateCookie(BYTE bType, WORD wIdent, HCONTACT hContact, void *pvExtra) +DWORD CIcqProto::AllocateCookie(BYTE bType, WORD wIdent, MCONTACT hContact, void *pvExtra) { icq_lock l(cookieMutex); @@ -96,7 +96,7 @@ int CIcqProto::GetCookieType(DWORD dwCookie) } -int CIcqProto::FindCookie(DWORD dwCookie, HCONTACT *phContact, void **ppvExtra) +int CIcqProto::FindCookie(DWORD dwCookie, MCONTACT *phContact, void **ppvExtra) { icq_lock l(cookieMutex); @@ -115,7 +115,7 @@ int CIcqProto::FindCookie(DWORD dwCookie, HCONTACT *phContact, void **ppvExtra) } -int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phContact) +int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, MCONTACT *phContact) { icq_lock l(cookieMutex); @@ -137,7 +137,7 @@ int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phCon } -int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContact, void** ppvExtra) +int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, MCONTACT *phContact, void** ppvExtra) { icq_lock l(cookieMutex); @@ -161,7 +161,7 @@ int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContac } -int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HCONTACT *phContact, cookie_message_data **ppvExtra) +int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, MCONTACT *phContact, cookie_message_data **ppvExtra) { icq_lock l(cookieMutex); @@ -277,7 +277,7 @@ cookie_message_data* CIcqProto::CreateMessageCookie(WORD bMsgType, BYTE bAckType } -cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, HCONTACT hContact, DWORD dwUin, int bUseSrvRelay) +cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, MCONTACT hContact, DWORD dwUin, int bUseSrvRelay) { BYTE bAckType; WORD wStatus = getContactStatus(hContact); diff --git a/protocols/IcqOscarJ/src/cookies.h b/protocols/IcqOscarJ/src/cookies.h index a6017d174c..a16f32b837 100644 --- a/protocols/IcqOscarJ/src/cookies.h +++ b/protocols/IcqOscarJ/src/cookies.h @@ -49,7 +49,7 @@ struct CIcqProto; struct icq_cookie_info { DWORD dwCookie; - HCONTACT hContact; + MCONTACT hContact; void *pvExtra; time_t dwTime; BYTE bType; @@ -114,7 +114,7 @@ struct cookie_search struct cookie_avatar { DWORD dwUin; - HCONTACT hContact; + MCONTACT hContact; unsigned int hashlen; BYTE *hash; unsigned int cbData; @@ -124,7 +124,7 @@ struct cookie_avatar struct cookie_reverse_connect: public cookie_message_data { - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; int type; void *ft; diff --git a/protocols/IcqOscarJ/src/directpackets.cpp b/protocols/IcqOscarJ/src/directpackets.cpp index fa42c76c7b..32a5186511 100644 --- a/protocols/IcqOscarJ/src/directpackets.cpp +++ b/protocols/IcqOscarJ/src/directpackets.cpp @@ -75,7 +75,7 @@ void CIcqProto::icq_sendDirectMsgAck(directconnect* dc, WORD wCookie, BYTE bMsgT } -DWORD CIcqProto::icq_sendGetAwayMsgDirect(HCONTACT hContact, int type) +DWORD CIcqProto::icq_sendGetAwayMsgDirect(MCONTACT hContact, int type) { icq_packet packet; DWORD dwCookie; @@ -123,7 +123,7 @@ void CIcqProto::icq_sendAwayMsgReplyDirect(directconnect* dc, WORD wCookie, BYTE } -void CIcqProto::icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer* ft) +void CIcqProto::icq_sendFileAcceptDirect(MCONTACT hContact, filetransfer* ft) { // v7 packet icq_packet packet; @@ -144,7 +144,7 @@ void CIcqProto::icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer* ft) } -void CIcqProto::icq_sendFileDenyDirect(HCONTACT hContact, filetransfer *ft, const char *szReason) +void CIcqProto::icq_sendFileDenyDirect(MCONTACT hContact, filetransfer *ft, const char *szReason) { // v7 packet icq_packet packet; @@ -233,7 +233,7 @@ int CIcqProto::icq_sendFileSendDirectv8(filetransfer *ft, const char *pszFiles) } -DWORD CIcqProto::icq_SendDirectMessage(HCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap) +DWORD CIcqProto::icq_SendDirectMessage(MCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap) { icq_packet packet; DWORD dwCookie = AllocateCookie(CKT_MESSAGE, 0, hContact, (void*)pCookieData); @@ -257,7 +257,7 @@ DWORD CIcqProto::icq_SendDirectMessage(HCONTACT hContact, const char *szMessage, return 0; // Failure } -void CIcqProto::icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType) +void CIcqProto::icq_sendXtrazRequestDirect(MCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType) { icq_packet packet; @@ -272,7 +272,7 @@ void CIcqProto::icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, ch SendDirectMessage(hContact, &packet); } -void CIcqProto::icq_sendXtrazResponseDirect(HCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType) +void CIcqProto::icq_sendXtrazResponseDirect(MCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType) { icq_packet packet; diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index a2f5ec6ac4..0e18163289 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -528,10 +528,10 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header } -char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResume) +char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, MCONTACT *hContactResume) { char* szList; - HCONTACT hContact; + MCONTACT hContact; WORD wCurrentLen = 0; DWORD dwUIN; uid_str szUID; @@ -611,7 +611,7 @@ char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResum void CIcqProto::sendEntireListServ(WORD wFamily, WORD wSubtype, int listType) { - HCONTACT hResumeContact = NULL; + MCONTACT hResumeContact = NULL; do { // server doesn't seem to be able to cope with packets larger than 8k diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp index af5d7a0fb7..65459c516a 100644 --- a/protocols/IcqOscarJ/src/fam_02location.cpp +++ b/protocols/IcqOscarJ/src/fam_02location.cpp @@ -47,7 +47,7 @@ void CIcqProto::handleLocationFam(BYTE *pBuffer, WORD wBufferLength, snac_header case ICQ_ERROR: { WORD wError; - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_fam15_data *pCookieData; @@ -124,17 +124,17 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie wLen -= 2; // Determine contact - HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); // Ignore away status if the user is not already on our list - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) { + if (hContact == INVALID_CONTACT_ID) { #ifdef _DEBUG debugLogA("Ignoring away reply (%s)", strUID(dwUIN, szUID)); #endif return; } - HCONTACT hCookieContact; + MCONTACT hCookieContact; if (!FindCookie(dwCookie, &hCookieContact, (void**)&pCookieData)) { debugLogA("Error: Received unexpected away reply from %s", strUID(dwUIN, szUID)); return; diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 9b1f01444c..c3c8098b98 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -196,8 +196,8 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info) wLen -= 2; // Ignore status notification if the user is not already on our list - HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); + if (hContact == INVALID_CONTACT_ID) { #ifdef _DEBUG debugLogA("Ignoring user online (%s)", strUID(dwUIN, szUID)); @@ -618,10 +618,10 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen) } // Determine contact - HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); // Skip contacts that are not already on our list or are already offline - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { WORD wOldStatus = getContactStatus(hContact); @@ -666,7 +666,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen) } -void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HCONTACT hContact, oscar_tlv_chain *pChain) +void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, MCONTACT hContact, oscar_tlv_chain *pChain) { DWORD dwStatusNoteTS = time(NULL); BYTE *pStatusNoteTS, *pStatusNote; diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index be7d453e55..b9c227d10b 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -200,7 +200,7 @@ void CIcqProto::handleRecvServMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef } -char* CIcqProto::convertMsgToUserSpecificUtf(HCONTACT hContact, const char *szMsg) +char* CIcqProto::convertMsgToUserSpecificUtf(MCONTACT hContact, const char *szMsg) { WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage); char *usMsg = NULL; @@ -268,7 +268,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char * PROTORECVEVENT pre = {0}; int bAdded; - HCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); while (pMessageTLV = pChain->getTLV(0x0101, wMsgPart)) { // Loop thru all message parts @@ -468,7 +468,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * if (CompareGUIDs(q1,q2,q3,q4, MCAP_SRV_RELAY_FMT)) { // we surely have at least 4 bytes for TLV chain - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (wCommand == 1) { @@ -504,7 +504,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * WORD wAckType = chain->getWord(0x0A, 1); // Update the saved DC info (if contact already exists) - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { DWORD dwIP, dwExternalIP; WORD wPort; @@ -575,8 +575,8 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * unpackLEDWord(&buf, &dwUin); - HCONTACT hContact = HContactFromUIN(dwUin, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromUIN(dwUin, NULL); + if (hContact == INVALID_CONTACT_ID) { debugLogA("Error: %s from unknown contact %u", "Reverse Connect Request", dwUin); } @@ -648,7 +648,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * } -void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType) +void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType) { WORD wId; @@ -677,7 +677,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, unpackLEWord(&pDataBuf, &wVersion); wLen -= 2; - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) setWord(hContact, "Version", wVersion); unpackDWord(&pDataBuf, &dwGuid1); // plugin type GUID @@ -886,7 +886,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, } -void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion) +void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion) { int nTypeId; WORD wFunction; @@ -1020,7 +1020,7 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HCONTACT hCo void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand) { - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (wCommand == 0) { // received contacts @@ -1231,7 +1231,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha else if (wCommand == 2) { // acknowledgement DWORD dwCookie; - HCONTACT hCookieContact; + MCONTACT hCookieContact; if (FindMessageCookie(dwID1, dwID2, &dwCookie, &hCookieContact, NULL)) { if (hCookieContact != hContact) debugLogA("Warning: Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact); @@ -1619,9 +1619,9 @@ void packPluginTypeId(icq_packet *packet, int nTypeID) } -void CIcqProto::handleStatusMsgReply(const char *szPrefix, HCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags) +void CIcqProto::handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags) { - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) { + if (hContact == INVALID_CONTACT_ID) { debugLogA("%sIgnoring status message from unknown contact %u", szPrefix, dwUin); return; } @@ -1649,10 +1649,10 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD { if (bFlags == 3) { - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_message_data *pCookieData = NULL; - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) { @@ -1684,7 +1684,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD /* this function send all acks from handleMessageTypes */ -void CIcqProto::sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs) +void CIcqProto::sendMessageTypesAck(MCONTACT hContact, int bUnicode, message_ack_params *pArgs) { if (pArgs) { @@ -1709,7 +1709,7 @@ void CIcqProto::sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack /* pMsg points to the beginning of the message */ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, DWORD dwMsgID, DWORD dwMsgID2, WORD wCookie, WORD wVersion, int type, int flags, WORD wAckType, DWORD dwDataLen, WORD wMsgLen, char *pMsg, int nMsgFlags, message_ack_params *pAckParams) { - HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE; + MCONTACT hContact = INVALID_CONTACT_ID; BOOL bThruDC = (nMsgFlags & MTF_DIRECT) == MTF_DIRECT; int bAdded; @@ -2205,12 +2205,12 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return; - HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); buf += 2; // 3. unknown wLen -= 2; - HCONTACT hCookieContact; + MCONTACT hCookieContact; if (!FindMessageCookie(dwMsgID1, dwMsgID2, &dwCookie, &hCookieContact, &pCookieData)) { debugLogA("SNAC(4.B) Received an ack that I did not ask for from (%u)", dwUin); return; @@ -2307,7 +2307,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d // An ack of some kind int ackType; - if (hContact == NULL || hContact == (HCONTACT)INVALID_HANDLE_VALUE) { + if (hContact == NULL || hContact == INVALID_CONTACT_ID) { debugLogA("SNAC(4.B) Message from unknown contact (%u)", dwUin); ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe return; @@ -2522,7 +2522,7 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD { WORD wError; char *pszErrorMessage; - HCONTACT hContact; + MCONTACT hContact; cookie_message_data *pCookieData = NULL; int nMessageType; @@ -2690,7 +2690,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque // Sender if (!unpackUID(&buf, &wLen, &dwUin, &szUID)) return; - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (FindCookie((WORD)dwSequence, NULL, (void**)&pCookieData)) { @@ -2698,7 +2698,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque // server ack should be ignored here. if (pCookieData && (pCookieData->nAckType == ACKTYPE_SERVER)) { - if ((hContact != NULL) && (hContact != (HCONTACT)INVALID_HANDLE_VALUE)) + if ((hContact != NULL) && (hContact != INVALID_CONTACT_ID)) { int ackType; int ackRes = ACKRESULT_SUCCESS; @@ -2889,9 +2889,9 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR // Sender if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return; - HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) return; + if (hContact == INVALID_CONTACT_ID) return; // Typing notification code unpackWord(&buf, &wNotification); @@ -2934,7 +2934,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR } -void CIcqProto::sendTypingNotification(HCONTACT hContact, WORD wMTNCode) +void CIcqProto::sendTypingNotification(MCONTACT hContact, WORD wMTNCode) { _ASSERTE((wMTNCode == MTN_FINISHED) || (wMTNCode == MTN_TYPED) || (wMTNCode == MTN_BEGUN) || (wMTNCode == MTN_WINDOW_CLOSED)); diff --git a/protocols/IcqOscarJ/src/fam_09bos.cpp b/protocols/IcqOscarJ/src/fam_09bos.cpp index 203ba13b00..98c0f58126 100644 --- a/protocols/IcqOscarJ/src/fam_09bos.cpp +++ b/protocols/IcqOscarJ/src/fam_09bos.cpp @@ -85,7 +85,7 @@ void CIcqProto::handlePrivacyRightsReply(unsigned char *pBuffer, WORD wBufferLen debugLogA("Warning: Malformed SRV_PRIVACY_RIGHTS_REPLY"); } -void CIcqProto::makeContactTemporaryVisible(HCONTACT hContact) +void CIcqProto::makeContactTemporaryVisible(MCONTACT hContact) { DWORD dwUin; uid_str szUid; diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index fe15da519c..a0d238cb99 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -772,9 +772,9 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError) } -HCONTACT CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded) +MCONTACT CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded) { - HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE; + MCONTACT hContact = INVALID_CONTACT_ID; if (!IsStringUIN(szRecordName)) { // probably AIM contact @@ -904,12 +904,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server case SSI_ITEM_BUDDY: { /* this is a contact */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { int bRegroup = 0; int bNicked = 0; @@ -1172,12 +1172,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* item on visible list */ /* wItemId not related to contact ID */ /* pszRecordName is the UIN */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { if (bAdded) { @@ -1211,12 +1211,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* Item on invisible list */ /* wItemId not related to contact ID */ /* pszRecordName is the UIN */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { if (bAdded) { @@ -1269,12 +1269,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* item on ignore list */ /* wItemId not related to contact ID */ /* pszRecordName is the UIN */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { if (bAdded) { @@ -1471,9 +1471,9 @@ void CIcqProto::handleServerCListItemAdd(const char *szRecordName, WORD wGroupId void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData) { - HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; + MCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY) + if (hContact != INVALID_CONTACT_ID && wItemType == SSI_ITEM_BUDDY) { // a contact was updated on server if (pItemData) { @@ -1586,9 +1586,9 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData) { - HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; + MCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY) + if (hContact != INVALID_CONTACT_ID && wItemType == SSI_ITEM_BUDDY) { // a contact was removed from our list if (getWord(hContact, DBSETTING_SERVLIST_ID, 0) == wItemId) { @@ -1632,7 +1632,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen) if (wReasonLen > wLen) return; - HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); PROTORECVEVENT pre = { 0 }; pre.timestamp = time(NULL); @@ -1720,7 +1720,7 @@ void CIcqProto::handleRecvAdded(unsigned char *buf, WORD wLen) return; } - HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); cbBlob=sizeof(DWORD)*2+4; @@ -1782,8 +1782,8 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen) return; } - HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); + if (hContact != INVALID_CONTACT_ID) szNick = NickFromHandle(hContact); if (wLen > 0) diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index bedd63885b..b120bc0fb0 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -88,7 +88,7 @@ void CIcqProto::handleExtensionError(BYTE *buf, WORD wPackLen) // more sofisticated detection, send ack if (wSubType == META_REQUEST_FULL_INFO) { - HCONTACT hContact; + MCONTACT hContact; cookie_fam15_data *pCookieData = NULL; int foundCookie = FindCookie(wCookie, &hContact, (void**)&pCookieData); @@ -578,7 +578,7 @@ UserInfoRecordItem rInterest[] = { }; -int CIcqProto::parseUserInfoRecord(HCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords) +int CIcqProto::parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords) { int nRecords = 0; @@ -648,7 +648,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR } cookie_directory_data *pCookieData; - HCONTACT hContact; + MCONTACT hContact; // check request cookie if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData) { @@ -843,7 +843,7 @@ static int calcAgeFromBirthDate(double dDate) } -void CIcqProto::parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType) +void CIcqProto::parseDirectoryUserDetailsData(MCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType) { oscar_tlv *pTLV; WORD wRecordCount; @@ -862,7 +862,7 @@ void CIcqProto::parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain dwUin = atoi(szUid); hContact = HContactFromUID(dwUin, szUid, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) { debugLogA("Error: Received details for unknown contact \"%s\"", szUid); SAFE_FREE(&szUid); @@ -1152,7 +1152,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO } cookie_directory_data *pCookieData; - HCONTACT hContact; + MCONTACT hContact; // check request cookie if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData) { diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index a8eba258f9..aa3ee36ba9 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -205,7 +205,7 @@ BYTE* calcMD5HashOfFile(const TCHAR *tszFile) } -int CIcqProto::IsAvatarChanged(HCONTACT hContact, const BYTE *pHash, int nHashLen) +int CIcqProto::IsAvatarChanged(MCONTACT hContact, const BYTE *pHash, int nHashLen) { DBVARIANT dbvSaved = {0}; @@ -451,7 +451,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY // handle Contact's avatar hash -void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus) +void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus) { int bJob = FALSE; BOOL avatarInfoPresent = FALSE; @@ -696,7 +696,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hCont // request avatar data from server -int CIcqProto::GetAvatarData(HCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) +int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) { uid_str szUidData; char *pszUid = NULL; @@ -803,7 +803,7 @@ int CIcqProto::GetAvatarData(HCONTACT hContact, DWORD dwUin, const char *szUid, // upload avatar data to server -int CIcqProto::SetAvatarData(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) +int CIcqProto::SetAvatarData(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) { m_avatarsMutex->Enter(); @@ -958,7 +958,7 @@ void avatars_server_connection::shutdownConnection() Netlib_Shutdown(hConnection); } -DWORD avatars_server_connection::sendGetAvatarRequest(HCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) +DWORD avatars_server_connection::sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) { int i; DWORD dwNow = GetTickCount(); @@ -1055,7 +1055,7 @@ DWORD avatars_server_connection::sendGetAvatarRequest(HCONTACT hContact, DWORD d } -DWORD avatars_server_connection::sendUploadAvatarRequest(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) +DWORD avatars_server_connection::sendUploadAvatarRequest(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) { cookie_avatar *ack = (cookie_avatar*)SAFE_MALLOC(sizeof(cookie_avatar)); if (!ack) return 0; // Failure: out of memory diff --git a/protocols/IcqOscarJ/src/icq_avatar.h b/protocols/IcqOscarJ/src/icq_avatar.h index 4323ffda8b..899521929e 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.h +++ b/protocols/IcqOscarJ/src/icq_avatar.h @@ -69,7 +69,7 @@ protected: rates *m_rates; icq_critical_section *m_ratesMutex; - HCONTACT runContact[4]; + MCONTACT runContact[4]; DWORD runTime[4]; int runCount; void checkRequestQueue(); @@ -85,8 +85,8 @@ public: __inline BOOL isPending() { return !isLoggedIn; }; __inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; }; - DWORD sendGetAvatarRequest(HCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); - DWORD sendUploadAvatarRequest(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); + DWORD sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); + DWORD sendUploadAvatarRequest(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); }; __inline static void SAFE_DELETE(avatars_server_connection **p) { SAFE_DELETE((lockable_struct**)p); }; @@ -95,7 +95,7 @@ __inline static void SAFE_DELETE(avatars_server_connection **p) { SAFE_DELETE((l struct avatars_request : public MZeroedObject { int type; - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; uid_str szUid; BYTE *hash; diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp index 2ea61ae5e2..198bbd2ade 100644 --- a/protocols/IcqOscarJ/src/icq_clients.cpp +++ b/protocols/IcqOscarJ/src/icq_clients.cpp @@ -186,7 +186,7 @@ const char* cliQip = "QIP %s"; const char* cliIM2 = "IM2"; const char* cliSpamBot = "Spam Bot"; -const char* CIcqProto::detectUserClient(HCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, +const char* CIcqProto::detectUserClient(MCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, WORD wVersion, DWORD dwFT1, DWORD dwFT2, DWORD dwFT3, BYTE bDirectFlag, DWORD dwDirectCookie, DWORD dwWebPort, /* ICQ specific */ BYTE *caps, WORD wLen, /* Client capabilities */ BYTE *bClientId, /* Output: detected client-type */ diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index c54d389a53..f605d7605d 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -29,12 +29,12 @@ // ----------------------------------------------------------------------------- #include "icqoscar.h" -int CIcqProto::getSetting(HCONTACT hContact, const char *szSetting, DBVARIANT *dbv) +int CIcqProto::getSetting(MCONTACT hContact, const char *szSetting, DBVARIANT *dbv) { return db_get_s(hContact, m_szModuleName, szSetting, dbv, 0); } -double CIcqProto::getSettingDouble(HCONTACT hContact, const char *szSetting, double dDef) +double CIcqProto::getSettingDouble(MCONTACT hContact, const char *szSetting, double dDef) { DBVARIANT dbv = {DBVT_DELETED}; double dRes; @@ -51,12 +51,12 @@ double CIcqProto::getSettingDouble(HCONTACT hContact, const char *szSetting, dou return dRes; } -DWORD CIcqProto::getContactUin(HCONTACT hContact) +DWORD CIcqProto::getContactUin(MCONTACT hContact) { return getDword(hContact, UNIQUEIDSETTING, 0); } -int CIcqProto::getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid) +int CIcqProto::getContactUid(MCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid) { DBVARIANT dbv = {DBVT_DELETED}; int iRes = 1; @@ -82,7 +82,7 @@ int CIcqProto::getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid) return iRes; } -char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szModule, const char *szSetting, char *szDef) +char* CIcqProto::getSettingStringUtf(MCONTACT hContact, const char *szModule, const char *szSetting, char *szDef) { DBVARIANT dbv = {DBVT_DELETED}; if ( db_get_utf(hContact, szModule, szSetting, &dbv)) { @@ -95,17 +95,17 @@ char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szModule, co return szRes; } -char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szSetting, char *szDef) +char* CIcqProto::getSettingStringUtf(MCONTACT hContact, const char *szSetting, char *szDef) { return getSettingStringUtf(hContact, m_szModuleName, szSetting, szDef); } -WORD CIcqProto::getContactStatus(HCONTACT hContact) +WORD CIcqProto::getContactStatus(MCONTACT hContact) { return getWord(hContact, "Status", ID_STATUS_OFFLINE); } -int CIcqProto::getSettingStringStatic(HCONTACT hContact, const char *szSetting, char *dest, int dest_len) +int CIcqProto::getSettingStringStatic(MCONTACT hContact, const char *szSetting, char *dest, int dest_len) { if (!db_get_static(hContact, m_szModuleName, szSetting, dest, dest_len)) return 0; @@ -113,17 +113,17 @@ int CIcqProto::getSettingStringStatic(HCONTACT hContact, const char *szSetting, return db_get_static_utf(hContact, m_szModuleName, szSetting, dest, dest_len); } -int CIcqProto::setSettingDouble(HCONTACT hContact, const char *szSetting, double dValue) +int CIcqProto::setSettingDouble(MCONTACT hContact, const char *szSetting, double dValue) { return setSettingBlob(hContact, szSetting, (BYTE*)&dValue, sizeof(double)); } -int CIcqProto::setSettingBlob(HCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue) +int CIcqProto::setSettingBlob(MCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue) { return db_set_blob(hContact, m_szModuleName, szSetting, (void*)pValue, cbValue); } -int CIcqProto::setContactHidden(HCONTACT hContact, BYTE bHidden) +int CIcqProto::setContactHidden(MCONTACT hContact, BYTE bHidden) { int nResult = db_set_b(hContact, "CList", "Hidden", bHidden); if (!bHidden) // clear zero setting @@ -132,7 +132,7 @@ int CIcqProto::setContactHidden(HCONTACT hContact, BYTE bHidden) return nResult; } -void CIcqProto::setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAnsi) +void CIcqProto::setStatusMsgVar(MCONTACT hContact, char* szStatusMsg, bool isAnsi) { if (szStatusMsg && szStatusMsg[0]) { if (isAnsi) { @@ -171,14 +171,14 @@ void CIcqProto::setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAns else db_unset(hContact, "CList", "StatusMsg"); } -int CIcqProto::IsICQContact(HCONTACT hContact) +int CIcqProto::IsICQContact(MCONTACT hContact) { char* szProto = GetContactProto(hContact); return !strcmpnull(szProto, m_szModuleName); } -HANDLE CIcqProto::AddEvent(HCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob) +HANDLE CIcqProto::AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = m_szModuleName; @@ -190,9 +190,9 @@ HANDLE CIcqProto::AddEvent(HCONTACT hContact, WORD wType, DWORD dwTime, DWORD fl return db_event_add(hContact, &dbei); } -HCONTACT CIcqProto::FindFirstContact() +MCONTACT CIcqProto::FindFirstContact() { - HCONTACT hContact = db_find_first(m_szModuleName); + MCONTACT hContact = db_find_first(m_szModuleName); if (IsICQContact(hContact)) return hContact; @@ -200,7 +200,7 @@ HCONTACT CIcqProto::FindFirstContact() return FindNextContact(hContact); } -HCONTACT CIcqProto::FindNextContact(HCONTACT hContact) +MCONTACT CIcqProto::FindNextContact(MCONTACT hContact) { hContact = db_find_next(hContact, m_szModuleName); while (hContact != NULL) @@ -212,7 +212,7 @@ HCONTACT CIcqProto::FindNextContact(HCONTACT hContact) return hContact; } -char* CIcqProto::getContactCListGroup(HCONTACT hContact) +char* CIcqProto::getContactCListGroup(MCONTACT hContact) { return getSettingStringUtf(hContact, "CList", "Group", NULL); } diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 095ad7734e..0369bdd8b9 100644 --- a/protocols/IcqOscarJ/src/icq_direct.cpp +++ b/protocols/IcqOscarJ/src/icq_direct.cpp @@ -34,7 +34,7 @@ struct directthreadstartinfo int type; // Only valid for outgoing connections int incoming; // 1=incoming, 0=outgoing HANDLE hConnection; // only valid for incoming connections, handle to the connection - HCONTACT hContact; // Only valid for outgoing connections + MCONTACT hContact; // Only valid for outgoing connections void* pvExtra; // Only valid for outgoing connections }; @@ -48,7 +48,7 @@ static char client_check_data[] = { "ICQ Service and Information may\0" }; -void CIcqProto::CloseContactDirectConns(HCONTACT hContact) +void CIcqProto::CloseContactDirectConns(MCONTACT hContact) { icq_lock l(directConnListMutex); @@ -116,7 +116,7 @@ int CIcqProto::sendDirectPacket(directconnect* dc, icq_packet* pkt) return nResult; } -directthreadstartinfo* CreateDTSI(HCONTACT hContact, HANDLE hConnection, int type) +directthreadstartinfo* CreateDTSI(MCONTACT hContact, HANDLE hConnection, int type) { directthreadstartinfo* dtsi = (directthreadstartinfo*)SAFE_MALLOC(sizeof(directthreadstartinfo)); dtsi->hContact = hContact; @@ -131,7 +131,7 @@ directthreadstartinfo* CreateDTSI(HCONTACT hContact, HANDLE hConnection, int typ // Check if we have an open and initialized DC with type // 'type' to the specified contact -BOOL CIcqProto::IsDirectConnectionOpen(HCONTACT hContact, int type, int bPassive) +BOOL CIcqProto::IsDirectConnectionOpen(MCONTACT hContact, int type, int bPassive) { BOOL bIsOpen = FALSE, bIsCreated = FALSE; @@ -182,7 +182,7 @@ void icq_newConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pE } // Opens direct connection of specified type to specified contact -void CIcqProto::OpenDirectConnection(HCONTACT hContact, int type, void* pvExtra) +void CIcqProto::OpenDirectConnection(MCONTACT hContact, int type, void* pvExtra) { // Create a new connection directthreadstartinfo* dtsi = CreateDTSI(hContact, NULL, type); @@ -596,7 +596,7 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) DWORD dwUin; DWORD dwPort; DWORD dwCookie; - HCONTACT hContact; + MCONTACT hContact; if (wLen != 0x30) { @@ -639,7 +639,7 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) if (dc->dwRemoteUin || !dc->dwReqId) { // OMG! Licq sends on reverse connection empty uin hContact = HContactFromUIN(dc->dwRemoteUin, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) { NetLog_Direct("Error: Received PEER_INIT from %u not on my list", dwUin); CloseDirectConnection(dc); @@ -1009,7 +1009,7 @@ int DecryptDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) } // This should be called only if connection already exists -int CIcqProto::SendDirectMessage(HCONTACT hContact, icq_packet *pkt) +int CIcqProto::SendDirectMessage(MCONTACT hContact, icq_packet *pkt) { icq_lock l(directConnListMutex); diff --git a/protocols/IcqOscarJ/src/icq_direct.h b/protocols/IcqOscarJ/src/icq_direct.h index 76ccd0d2dc..bb8c38d29f 100644 --- a/protocols/IcqOscarJ/src/icq_direct.h +++ b/protocols/IcqOscarJ/src/icq_direct.h @@ -39,7 +39,7 @@ struct filetransfer: public basic_filetransfer DWORD dwCookie; DWORD dwUin; DWORD dwRemotePort; - HCONTACT hContact; + MCONTACT hContact; char *szFilename; char *szDescription; char *szSavePath; @@ -68,7 +68,7 @@ struct filetransfer: public basic_filetransfer struct directconnect { - HCONTACT hContact; + MCONTACT hContact; HANDLE hConnection; DWORD dwConnectionCookie; int type; diff --git a/protocols/IcqOscarJ/src/icq_directmsg.cpp b/protocols/IcqOscarJ/src/icq_directmsg.cpp index d5a4ccdced..df34189cb0 100644 --- a/protocols/IcqOscarJ/src/icq_directmsg.cpp +++ b/protocols/IcqOscarJ/src/icq_directmsg.cpp @@ -165,7 +165,7 @@ void CIcqProto::handleDirectMessage(directconnect* dc, PBYTE buf, WORD wLen) } else { - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_message_data *pCookieData = NULL; if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) @@ -303,7 +303,7 @@ void CIcqProto::handleDirectGreetingMessage(directconnect* dc, PBYTE buf, WORD w } else if (typeId && wCommand == DIRECT_ACK) { - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_message_data *pCookieData = NULL; if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index fa4c3942d1..eeb0f7313d 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -33,7 +33,7 @@ void CIcqProto::handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, { char* pszFileName = NULL; DWORD dwFileSize; - HCONTACT hCookieContact; + MCONTACT hCookieContact; WORD wPort; WORD wFilenameLength; filetransfer* ft; @@ -107,7 +107,7 @@ void CIcqProto::handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, OpenDirectConnection(ft->hContact, DIRECTCONN_FILE, ft); } -filetransfer* CIcqProto::CreateFileTransfer(HCONTACT hContact, DWORD dwUin, int nVersion) +filetransfer* CIcqProto::CreateFileTransfer(MCONTACT hContact, DWORD dwUin, int nVersion) { filetransfer *ft = CreateIcqFileTransfer(); @@ -154,7 +154,7 @@ void CIcqProto::handleFileRequest(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCoo wLen -= 4; int bAdded; - HCONTACT hContact = HContactFromUIN(dwUin, &bAdded); + MCONTACT hContact = HContactFromUIN(dwUin, &bAdded); // Initialize a filetransfer struct filetransfer *ft = CreateFileTransfer(hContact, dwUin, nVersion); @@ -191,7 +191,7 @@ void CIcqProto::handleDirectCancel(directconnect *dc, PBYTE buf, WORD wLen, WORD // ******************************************************************************* -void CIcqProto::icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft) +void CIcqProto::icq_CancelFileTransfer(MCONTACT hContact, filetransfer* ft) { DWORD dwCookie; diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp index 969607b6be..3771044872 100644 --- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp +++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp @@ -55,7 +55,7 @@ void CIcqProto::icq_InitInfoUpdate(void) // Returns TRUE if user was queued // Returns FALSE if the list was full -BOOL CIcqProto::icq_QueueUser(HCONTACT hContact) +BOOL CIcqProto::icq_QueueUser(MCONTACT hContact) { if ( !infoUpdateMutex ) return FALSE; @@ -155,7 +155,7 @@ void CIcqProto::icq_RescanInfoUpdate() bInfoUpdateEnabled = 0; // freeze thread // Queue all outdated users - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact != NULL) { if (IsMetaInfoChanged(hContact)) diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp index 5538103a41..f06e5eea20 100644 --- a/protocols/IcqOscarJ/src/icq_menu.cpp +++ b/protocols/IcqOscarJ/src/icq_menu.cpp @@ -39,7 +39,7 @@ static int sttCompareProtocols(const CIcqProto *p1, const CIcqProto *p2) LIST g_Instances(1, sttCompareProtocols); -static CIcqProto* IcqGetInstanceByHContact(HCONTACT hContact) +static CIcqProto* IcqGetInstanceByHContact(MCONTACT hContact) { char* szProto = GetContactProto(hContact); if (szProto == NULL) @@ -54,37 +54,37 @@ static CIcqProto* IcqGetInstanceByHContact(HCONTACT hContact) static INT_PTR IcqMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->RequestAuthorization(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->GrantAuthorization(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleRevokeAuth(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->RevokeAuthorization(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleAddServContact(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->AddServerContact(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleXStatusDetails(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->ShowXStatusDetails(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleOpenProfile(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OpenWebProfile(wParam, lParam) : 0; } @@ -97,7 +97,7 @@ static int IcqPrebuildContactMenu( WPARAM wParam, LPARAM lParam ) Menu_ShowItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], FALSE); Menu_ShowItem(g_hContactMenuItems[ICMI_OPEN_PROFILE], FALSE); - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OnPreBuildContactMenu(wParam, lParam) : 0; } @@ -177,7 +177,7 @@ void g_MenuUninit(void) INT_PTR CIcqProto::OpenWebProfile(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DWORD dwUin = getContactUin(hContact); char url[256]; mir_snprintf(url, sizeof(url), "http://www.icq.com/people/%d",dwUin); @@ -187,7 +187,7 @@ INT_PTR CIcqProto::OpenWebProfile(WPARAM wParam, LPARAM lParam) int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL) return 0; diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp index ba3572b61f..b34a8b780a 100644 --- a/protocols/IcqOscarJ/src/icq_popups.cpp +++ b/protocols/IcqOscarJ/src/icq_popups.cpp @@ -200,7 +200,7 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return FALSE; } -int CIcqProto::ShowPopupMsg(HCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType) +int CIcqProto::ShowPopupMsg(MCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType) { if (bPopupService && getByte("PopupsEnabled", DEFAULT_POPUPS_ENABLED)) { diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 6754e296c8..bfe5e66277 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -291,7 +291,7 @@ int CIcqProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) ModuleLoad(0, 0); InitXStatusItems(FALSE); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact != NULL) { DWORD bXStatus = getContactXStatus(hContact); if (bXStatus > 0) @@ -316,7 +316,7 @@ int CIcqProto::OnPreShutdown(WPARAM wParam, LPARAM lParam) //////////////////////////////////////////////////////////////////////////////////////// // PS_AddToList - adds a contact to the contact list -HCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { if (psr) { if (psr->cbSize == sizeof(ICQSEARCHRESULT)) { @@ -354,7 +354,7 @@ HCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return 0; // Failure } -HCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { DWORD uin = 0; uid_str uid = { 0 }; @@ -420,8 +420,8 @@ HCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDb int CIcqProto::Authorize(HANDLE hDbEvent) { if (icqOnline() && hDbEvent) { - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; DWORD uin; @@ -446,8 +446,8 @@ int CIcqProto::Authorize(HANDLE hDbEvent) int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) { if (icqOnline() && hDbEvent) { - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; DWORD uin; @@ -470,7 +470,7 @@ int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CIcqProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CIcqProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) { setContactHidden(hContact, 0); ICQAddRecvEvent(NULL, EVENTTYPE_AUTHREQUEST, pre, pre->lParam, (PBYTE)pre->szMessage, 0); @@ -480,7 +480,7 @@ int __cdecl CIcqProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CIcqProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage) +int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) { if (!icqOnline()) return 1; @@ -515,7 +515,7 @@ HANDLE __cdecl CIcqProto::ChangeInfo(int iInfoType, void* pInfoData) //////////////////////////////////////////////////////////////////////////////////////// // PS_FileAllow - starts a file transfer -HANDLE __cdecl CIcqProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath) +HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath) { DWORD dwUin; uid_str szUid; @@ -558,7 +558,7 @@ HANDLE __cdecl CIcqProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const T //////////////////////////////////////////////////////////////////////////////////////// // PS_FileCancel - cancels a file transfer -int __cdecl CIcqProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int __cdecl CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { DWORD dwUin; uid_str szUid; @@ -588,7 +588,7 @@ int __cdecl CIcqProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // PS_FileDeny - denies a file transfer -int __cdecl CIcqProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason) +int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason) { int nReturnValue = 1; DWORD dwUin; @@ -657,7 +657,7 @@ int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CIcqProto::GetCaps(int type, MCONTACT hContact) { DWORD_PTR nReturn = 0; @@ -742,7 +742,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info -int __cdecl CIcqProto::GetInfo(HCONTACT hContact, int infoType) +int __cdecl CIcqProto::GetInfo(MCONTACT hContact, int infoType) { if (icqOnline()) { DWORD dwUin; @@ -923,7 +923,7 @@ HWND __cdecl CIcqProto::SearchAdvanced(HWND hwndDlg) //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CIcqProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) { ICQSEARCHRESULT **isrList = (ICQSEARCHRESULT**)pre->szMessage; int i; @@ -974,7 +974,7 @@ int __cdecl CIcqProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CIcqProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) +int __cdecl CIcqProto::RecvFile(MCONTACT hContact, PROTORECVFILET* evt) { return Proto_RecvFile(hContact, evt); } @@ -983,7 +983,7 @@ int __cdecl CIcqProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CIcqProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CIcqProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { DWORD cbBlob; DWORD flags = 0; @@ -1009,7 +1009,7 @@ int __cdecl CIcqProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CIcqProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CIcqProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -1018,7 +1018,7 @@ int __cdecl CIcqProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CIcqProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { if (hContact && hContactsList) { int i; @@ -1289,7 +1289,7 @@ int __cdecl CIcqProto::SendContacts(HCONTACT hContact, int flags, int nContacts, //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CIcqProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) +HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) { if (!icqOnline()) return 0; @@ -1391,7 +1391,7 @@ HANDLE __cdecl CIcqProto::SendFile(HCONTACT hContact, const TCHAR* szDescription //////////////////////////////////////////////////////////////////////////////////////// // PS_SendMessage - sends a message -int __cdecl CIcqProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { if (hContact == NULL || pszSrc == NULL) return NULL; @@ -1581,7 +1581,7 @@ int __cdecl CIcqProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CIcqProto::SendUrl(HCONTACT hContact, int flags, const char* url) +int __cdecl CIcqProto::SendUrl(MCONTACT hContact, int flags, const char* url) { if (hContact == NULL || url == NULL) return 0; @@ -1646,7 +1646,7 @@ int __cdecl CIcqProto::SendUrl(HCONTACT hContact, int flags, const char* url) //////////////////////////////////////////////////////////////////////////////////////// // PS_SetApparentMode - sets the visibility status -int __cdecl CIcqProto::SetApparentMode(HCONTACT hContact, int mode) +int __cdecl CIcqProto::SetApparentMode(MCONTACT hContact, int mode) { DWORD uin; uid_str uid; @@ -1840,7 +1840,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus) struct status_message_thread_data { - HCONTACT hContact; + MCONTACT hContact; char *szMessage; HANDLE hProcess; }; @@ -1866,7 +1866,7 @@ void __cdecl CIcqProto::GetAwayMsgThread(void *pStatusData) //////////////////////////////////////////////////////////////////////////////////////// // PS_GetAwayMsg - returns a contact's away message -HANDLE __cdecl CIcqProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CIcqProto::GetAwayMsg(MCONTACT hContact) { DWORD dwUin; uid_str szUID; @@ -1949,7 +1949,7 @@ HANDLE __cdecl CIcqProto::GetAwayMsg(HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG - processes received status mode message -int __cdecl CIcqProto::RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* evt) +int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* evt) { if (evt->flags & PREF_UTF) { setStatusMsgVar(hContact, evt->szMessage, false); @@ -2039,7 +2039,7 @@ INT_PTR CIcqProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // PS_UserIsTyping - sends a UTN notification -int __cdecl CIcqProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CIcqProto::UserIsTyping(MCONTACT hContact, int type) { if (hContact && icqOnline()) { if (CheckContactCapabilities(hContact, CAPF_TYPING)) { diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 44e23e627f..1f8e28dcdf 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -41,7 +41,7 @@ struct userinfo { DWORD dwUin; - HCONTACT hContact; + MCONTACT hContact; time_t queued; }; @@ -54,23 +54,23 @@ struct CIcqProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const PROTOCHAR *id); virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR *email); @@ -78,24 +78,24 @@ struct CIcqProto : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); - virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char *msg); - virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char *url); + virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char *url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); @@ -127,7 +127,7 @@ struct CIcqProto : public PROTO INT_PTR __cdecl OnCreateAccMgrUI(WPARAM, LPARAM); //====| Events |====================================================================== - void __cdecl OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONTACT hContact); + void __cdecl OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONTACT hContact); int __cdecl OnIdleChanged(WPARAM, LPARAM); int __cdecl OnModernOptInit(WPARAM, LPARAM); int __cdecl OnModulesLoaded(WPARAM, LPARAM); @@ -138,8 +138,8 @@ struct CIcqProto : public PROTO int __cdecl OnProcessSrmmIconClick(WPARAM, LPARAM); int __cdecl OnProcessSrmmEvent(WPARAM, LPARAM); int __cdecl OnReloadIcons(WPARAM, LPARAM); - void __cdecl OnRenameContact(DBCONTACTWRITESETTING *cws, HCONTACT hContact); - void __cdecl OnRenameGroup( DBCONTACTWRITESETTING *cws, HCONTACT hContact); + void __cdecl OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT hContact); + void __cdecl OnRenameGroup( DBCONTACTWRITESETTING *cws, MCONTACT hContact); int __cdecl OnUserInfoInit(WPARAM, LPARAM); int __cdecl OnPreBuildStatusMenu(WPARAM, LPARAM); @@ -182,22 +182,22 @@ struct CIcqProto : public PROTO //----| capabilities.cpp |------------------------------------------------------------ // Deletes all oscar capabilities for a given contact. - void ClearAllContactCapabilities(HCONTACT hContact); + void ClearAllContactCapabilities(MCONTACT hContact); // Deletes one or many oscar capabilities for a given contact. - void ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities); + void ClearContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities); // Sets one or many oscar capabilities for a given contact. - void SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities); + void SetContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities); // Returns true if the given contact supports the requested capabilites. - BOOL CheckContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities); + BOOL CheckContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities); // Scans a binary buffer for oscar capabilities and adds them to the contact. - void AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength); + void AddCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength); // Scans a binary buffer for oscar capabilities and sets them to the contact. - void SetCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset); + void SetCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset); //----| chan_01login.cpp |------------------------------------------------------------ void handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *info); @@ -231,7 +231,7 @@ struct CIcqProto : public PROTO LIST cookies; WORD wCookieSeq; - DWORD AllocateCookie(BYTE bType, WORD wIdent, HCONTACT hContact, void *pvExtra); + DWORD AllocateCookie(BYTE bType, WORD wIdent, MCONTACT hContact, void *pvExtra); void FreeCookie(DWORD dwCookie); void FreeCookieByData(BYTE bType, void *pvExtra); void ReleaseCookie(DWORD dwCookie); @@ -239,32 +239,32 @@ struct CIcqProto : public PROTO int GetCookieType(DWORD dwCookie); - int FindCookie(DWORD wCookie, HCONTACT *phContact, void **ppvExtra); - int FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phContact); - int FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContact, void **ppvExtra); - int FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HCONTACT *phContact, cookie_message_data **ppvExtra); + int FindCookie(DWORD wCookie, MCONTACT *phContact, void **ppvExtra); + int FindCookieByData(void *pvExtra, DWORD *pdwCookie, MCONTACT *phContact); + int FindCookieByType(BYTE bType, DWORD *pdwCookie, MCONTACT *phContact, void **ppvExtra); + int FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, MCONTACT *phContact, cookie_message_data **ppvExtra); void InitMessageCookie(cookie_message_data *pCookie); cookie_message_data* CreateMessageCookie(WORD bMsgType, BYTE bAckType); - cookie_message_data* CreateMessageCookieData(BYTE bMsgType, HCONTACT hContact, DWORD dwUin, int bUseSrvRelay); + cookie_message_data* CreateMessageCookieData(BYTE bMsgType, MCONTACT hContact, DWORD dwUin, int bUseSrvRelay); void RemoveExpiredCookies(void); //----| directpackets.cpp |----------------------------------------------------------- void icq_sendDirectMsgAck(directconnect* dc, WORD wCookie, BYTE bMsgType, BYTE bMsgFlags, char* szCap); - DWORD icq_sendGetAwayMsgDirect(HCONTACT hContact, int type); + DWORD icq_sendGetAwayMsgDirect(MCONTACT hContact, int type); void icq_sendAwayMsgReplyDirect(directconnect *dc, WORD wCookie, BYTE msgType, const char** szMsg); - void icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer *ft); - void icq_sendFileDenyDirect(HCONTACT hContact, filetransfer *ft, const char *szReason); + void icq_sendFileAcceptDirect(MCONTACT hContact, filetransfer *ft); + void icq_sendFileDenyDirect(MCONTACT hContact, filetransfer *ft, const char *szReason); int icq_sendFileSendDirectv7(filetransfer *ft, const char *pszFiles); int icq_sendFileSendDirectv8(filetransfer *ft, const char *pszFiles); - DWORD icq_SendDirectMessage(HCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); - void icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType); - void icq_sendXtrazResponseDirect(HCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType); + DWORD icq_SendDirectMessage(MCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); + void icq_sendXtrazRequestDirect(MCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType); + void icq_sendXtrazResponseDirect(MCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType); //----| fam_01service.cpp |----------------------------------------------------------- void handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header *pSnacHeader, serverthread_info *info); - char* buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResume); + char* buildUinList(int subtype, WORD wMaxLen, MCONTACT *hContactResume); void sendEntireListServ(WORD wFamily, WORD wSubtype, int listType); void setUserInfo(void); void handleServUINSettings(int nPort, serverthread_info *info); @@ -278,7 +278,7 @@ struct CIcqProto : public PROTO void handleReplyBuddy(BYTE *buf, WORD wPackLen); void handleUserOffline(BYTE *buf, WORD wPackLen); void handleUserOnline(BYTE *buf, WORD wPackLen, serverthread_info *info); - void parseStatusNote(DWORD dwUin, char *szUid, HCONTACT hContact, oscar_tlv_chain *pChain); + void parseStatusNote(DWORD dwUin, char *szUid, MCONTACT hContact, oscar_tlv_chain *pChain); void handleNotifyRejected(BYTE *buf, WORD wPackLen); //----| fam_04message.cpp |----------------------------------------------------------- @@ -296,29 +296,29 @@ struct CIcqProto : public PROTO void handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); - void handleStatusMsgReply(const char *szPrefix, HCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags); + void handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags); void handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleMissedMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleOffineMessagesReply(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand); void handleRuntimeError(WORD wError); - void parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType); - void parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion); + void parseServRelayData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType); + void parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion); HANDLE handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD wVersion, int type, WORD wMsgLen, PBYTE buf, BYTE bFlags, int nMsgFlags); void handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, DWORD dwMsgID, DWORD dwMsgID2, WORD wCookie, WORD wVersion, int type, int flags, WORD wAckType, DWORD dwDataLen, WORD wMsgLen, char *pMsg, int nMsgFlags, message_ack_params *pAckParams); - void sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs); - void sendTypingNotification(HCONTACT hContact, WORD wMTNCode); + void sendMessageTypesAck(MCONTACT hContact, int bUnicode, message_ack_params *pArgs); + void sendTypingNotification(MCONTACT hContact, WORD wMTNCode); int unpackPluginTypeId(BYTE **pBuffer, WORD *pwLen, int *pTypeId, WORD *pFunctionId, BOOL bThruDC); - char* convertMsgToUserSpecificUtf(HCONTACT hContact, const char *szMsg); + char* convertMsgToUserSpecificUtf(MCONTACT hContact, const char *szMsg); //----| fam_09bos.cpp |--------------------------------------------------------------- void handleBosFam(unsigned char *pBuffer, WORD wBufferLength, snac_header* pSnacHeader); void handlePrivacyRightsReply(unsigned char *pBuffer, WORD wBufferLength); - void makeContactTemporaryVisible(HCONTACT hContact); + void makeContactTemporaryVisible(MCONTACT hContact); //----| fam_0alookup.cpp |------------------------------------------------------------ void handleLookupFam(unsigned char *pBuffer, WORD wBufferLength, snac_header* pSnacHeader); @@ -347,7 +347,7 @@ struct CIcqProto : public PROTO void handleRecvAuthResponse(BYTE *buf, WORD wLen); void handleRecvAdded(BYTE *buf, WORD wLen); - HCONTACT HContactFromRecordName(const char *szRecordName, int *bAdded); + MCONTACT HContactFromRecordName(const char *szRecordName, int *bAdded); void processCListReply(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData); @@ -367,12 +367,12 @@ struct CIcqProto : public PROTO void handleExtensionServerInfo(BYTE *buf, WORD wPackLen, WORD wFlags); void handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wFlags); - int parseUserInfoRecord(HCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords); + int parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords); void handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wReplySubtype, WORD wFlags); void handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wReplySubtype); - void parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType); + void parseDirectoryUserDetailsData(MCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType); void parseDirectorySearchData(oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType); void parseSearchReplies(unsigned char *databuf, WORD wPacketLen, WORD wCookie, WORD wReplySubtype, BYTE bResultCode); @@ -397,45 +397,45 @@ struct CIcqProto : public PROTO void __cdecl AvatarThread(avatars_server_connection *pInfo); void handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BYTE nDataLen); - void handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus); + void handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus); avatars_request *ReleaseAvatarRequestInQueue(avatars_request *request); TCHAR* GetOwnAvatarFileName(); void GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, TCHAR *pszDest, int cbLen); void GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, int cbLen); - int IsAvatarChanged(HCONTACT hContact, const BYTE *pHash, int nHashLen); + int IsAvatarChanged(MCONTACT hContact, const BYTE *pHash, int nHashLen); - int GetAvatarData(HCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); - int SetAvatarData(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); + int GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); + int SetAvatarData(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); void StartAvatarThread(HANDLE hConn, char* cookie, WORD cookieLen); void StopAvatarThread(); //----| icq_clients.cpp |------------------------------------------------------------- - const char* detectUserClient(HCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, WORD wVersion, DWORD dwFT1, DWORD dwFT2, DWORD dwFT3, BYTE bDirectFlag, DWORD dwDirectCookie, DWORD dwWebPort, BYTE *caps, WORD wLen, BYTE *bClientId, char *szClientBuf); + const char* detectUserClient(MCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, WORD wVersion, DWORD dwFT1, DWORD dwFT2, DWORD dwFT3, BYTE bDirectFlag, DWORD dwDirectCookie, DWORD dwWebPort, BYTE *caps, WORD wLen, BYTE *bClientId, char *szClientBuf); //----| icq_db.cpp |------------------------------------------------------------------ - HANDLE AddEvent(HCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob); - int IsICQContact(HCONTACT hContact); - - HCONTACT FindFirstContact(); - HCONTACT FindNextContact(HCONTACT hContact); - - int getSetting(HCONTACT hContact, const char *szSetting, DBVARIANT *dbv); - double getSettingDouble(HCONTACT hContact, const char *szSetting, double dDef); - int getSettingStringStatic(HCONTACT hContact, const char *szSetting, char *dest, int dest_len); - char* getSettingStringUtf(HCONTACT hContact, const char *szModule, const char *szSetting, char *szDef); - char* getSettingStringUtf(HCONTACT hContact, const char *szSetting, char *szDef); - int getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid); - DWORD getContactUin(HCONTACT hContact); - WORD getContactStatus(HCONTACT hContact); - char* getContactCListGroup(HCONTACT hContact); - - int setSettingDouble(HCONTACT hContact, const char *szSetting, double dValue); - int setSettingBlob(HCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue); - int setContactHidden(HCONTACT hContact, BYTE bHidden); - void setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAnsi); + HANDLE AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob); + int IsICQContact(MCONTACT hContact); + + MCONTACT FindFirstContact(); + MCONTACT FindNextContact(MCONTACT hContact); + + int getSetting(MCONTACT hContact, const char *szSetting, DBVARIANT *dbv); + double getSettingDouble(MCONTACT hContact, const char *szSetting, double dDef); + int getSettingStringStatic(MCONTACT hContact, const char *szSetting, char *dest, int dest_len); + char* getSettingStringUtf(MCONTACT hContact, const char *szModule, const char *szSetting, char *szDef); + char* getSettingStringUtf(MCONTACT hContact, const char *szSetting, char *szDef); + int getContactUid(MCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid); + DWORD getContactUin(MCONTACT hContact); + WORD getContactStatus(MCONTACT hContact); + char* getContactCListGroup(MCONTACT hContact); + + int setSettingDouble(MCONTACT hContact, const char *szSetting, double dValue); + int setSettingBlob(MCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue); + int setContactHidden(MCONTACT hContact, BYTE bHidden); + void setStatusMsgVar(MCONTACT hContact, char* szStatusMsg, bool isAnsi); //----| icq_direct.cpp |-------------------------------------------------------------- icq_critical_section *directConnListMutex; @@ -453,29 +453,29 @@ struct CIcqProto : public PROTO void sendPeerFileInit(directconnect* dc); int sendDirectPacket(directconnect* dc, icq_packet* pkt); - void CloseContactDirectConns(HCONTACT hContact); + void CloseContactDirectConns(MCONTACT hContact); directconnect* FindFileTransferDC(filetransfer* ft); filetransfer* FindExpectedFileRecv(DWORD dwUin, DWORD dwTotalSize); - BOOL IsDirectConnectionOpen(HCONTACT hContact, int type, int bPassive); - void OpenDirectConnection(HCONTACT hContact, int type, void* pvExtra); + BOOL IsDirectConnectionOpen(MCONTACT hContact, int type, int bPassive); + void OpenDirectConnection(MCONTACT hContact, int type, void* pvExtra); void CloseDirectConnection(directconnect *dc); - int SendDirectMessage(HCONTACT hContact, icq_packet *pkt); + int SendDirectMessage(MCONTACT hContact, icq_packet *pkt); //----| icq_directmsg.cpp |----------------------------------------------------------- void handleDirectMessage(directconnect* dc, PBYTE buf, WORD wLen); void handleDirectGreetingMessage(directconnect* dc, PBYTE buf, WORD wLen, WORD wCommand, WORD wCookie, BYTE bMsgType, BYTE bMsgFlags, WORD wStatus, WORD wFlags, char* pszText); //----| icq_filerequests.cpp |-------------------------------------------------------- - filetransfer* CreateFileTransfer(HCONTACT hContact, DWORD dwUin, int nVersion); + filetransfer* CreateFileTransfer(MCONTACT hContact, DWORD dwUin, int nVersion); void handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, WORD wStatus, char* pszText); void handleFileRequest(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, DWORD dwID1, DWORD dwID2, char* pszDescription, int nVersion, BOOL bDC); void handleDirectCancel(directconnect *dc, PBYTE buf, WORD wLen, WORD wCommand, DWORD dwCookie, WORD wMessageType, WORD wStatus, WORD wFlags, char* pszText); - void icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft); + void icq_CancelFileTransfer(MCONTACT hContact, filetransfer* ft); //----| icq_filetransfer.cpp |-------------------------------------------------------- - void icq_AcceptFileTransfer(HCONTACT hContact, filetransfer *ft); + void icq_AcceptFileTransfer(MCONTACT hContact, filetransfer *ft); void icq_sendFileResume(filetransfer *ft, int action, const char *szFilename); void icq_InitFileSend(filetransfer *ft); @@ -496,7 +496,7 @@ struct CIcqProto : public PROTO void __cdecl InfoUpdateThread(void*); void icq_InitInfoUpdate(void); // Queues all outdated users - BOOL icq_QueueUser(HCONTACT hContact); // Queue one UIN to the list for updating + BOOL icq_QueueUser(MCONTACT hContact); // Queue one UIN to the list for updating void icq_DequeueUser(DWORD dwUin); // Remove one UIN from the list void icq_RescanInfoUpdate(); // Add all outdated contacts to the list void icq_InfoUpdateCleanup(void); // Clean up on exit @@ -526,7 +526,7 @@ struct CIcqProto : public PROTO BOOL unpackUID(BYTE **ppBuf, WORD *pwLen, DWORD *pdwUIN, uid_str *ppszUID); //----| icq_popups.cpp |-------------------------------------------------------------- - int ShowPopupMsg(HCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType); + int ShowPopupMsg(MCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType); //----| icq_proto.cpp |-------------------------------------------------------------- void __cdecl CheekySearchThread( void* ); @@ -605,25 +605,25 @@ struct CIcqProto : public PROTO int servlistPendingSize; servlistpendingitem** servlistPendingList; - int servlistPendingFindItem(int nType, HCONTACT hContact, const char *pszGroup); + int servlistPendingFindItem(int nType, MCONTACT hContact, const char *pszGroup); void servlistPendingAddItem(servlistpendingitem* pItem); - servlistpendingitem* servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup); + servlistpendingitem* servlistPendingRemoveItem(int nType, MCONTACT hContact, const char *pszGroup); - void servlistPendingAddContactOperation(HCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags); + void servlistPendingAddContactOperation(MCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags); void servlistPendingAddGroupOperation(const char *pszGroup, LPARAM param, PENDING_GROUP_CALLBACK callback, DWORD flags); - int servlistPendingAddContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = NULL); + int servlistPendingAddContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = NULL); int servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPARAM param, PENDING_GROUP_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_GROUP_CALLBACK operationCallback = NULL); - void servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult); + void servlistPendingRemoveContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult); void servlistPendingRemoveGroup(const char *pszGroup, WORD wGroupID, int nResult); void servlistPendingFlushOperations(); // server-list support functions int nJustAddedCount; int nJustAddedSize; - HCONTACT* pdwJustAddedList; + MCONTACT* pdwJustAddedList; - void AddJustAddedContact(HCONTACT hContact); - BOOL IsContactJustAdded(HCONTACT hContact); + void AddJustAddedContact(MCONTACT hContact); + BOOL IsContactJustAdded(MCONTACT hContact); void FlushJustAddedContacts(); WORD GenerateServerID(int bGroupType, int bFlags, int wCount = 0); @@ -649,18 +649,18 @@ struct CIcqProto : public PROTO void servlistCreateGroup(const char *szGroupPath, LPARAM param, PENDING_GROUP_CALLBACK callback); int __cdecl servlistAddContact_gotGroup(const char *szGroup, WORD wGroupID, LPARAM lParam, int nResult); - int __cdecl servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult); - void servlistAddContact(HCONTACT hContact, const char *pszGroup); + int __cdecl servlistAddContact_Ready(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult); + void servlistAddContact(MCONTACT hContact, const char *pszGroup); - int __cdecl servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); - void servlistRemoveContact(HCONTACT hContact); + int __cdecl servlistRemoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); + void servlistRemoveContact(MCONTACT hContact); int __cdecl servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNewGroupID, LPARAM lParam, int nResult); - int __cdecl servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); - void servlistMoveContact(HCONTACT hContact, const char *pszNewGroup); + int __cdecl servlistMoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); + void servlistMoveContact(MCONTACT hContact, const char *pszNewGroup); - int __cdecl servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); - void servlistUpdateContact(HCONTACT hContact); + int __cdecl servlistUpdateContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); + void servlistUpdateContact(MCONTACT hContact); int __cdecl servlistRenameGroup_Ready(const char *szGroup, WORD wGroupID, LPARAM lParam, int nResult); void servlistRenameGroup(char *szGroup, WORD wGroupId, char *szNewGroup); @@ -671,20 +671,20 @@ struct CIcqProto : public PROTO void removeGroupPathLinks(WORD wGroupID); int getServListGroupLevel(WORD wGroupId); - void resetServContactAuthState(HCONTACT hContact, DWORD dwUin); + void resetServContactAuthState(MCONTACT hContact, DWORD dwUin); void FlushSrvGroupsCache(); int getCListGroupExists(const char *szGroup); - int moveContactToCListGroup(HCONTACT hContact, const char *szGroup); /// TODO: this should be DB function + int moveContactToCListGroup(MCONTACT hContact, const char *szGroup); /// TODO: this should be DB function DWORD icq_sendServerItem(DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wItemId, const char *szName, BYTE *pTLVs, int nTlvLength, WORD wItemType, DWORD dwOperation, DWORD dwTimeout, void **doubleObject); - DWORD icq_sendServerContact(HCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject); + DWORD icq_sendServerContact(MCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject); DWORD icq_sendSimpleItem(DWORD dwCookie, WORD wAction, DWORD dwUin, char* szUID, WORD wGroupId, WORD wItemId, WORD wItemType, DWORD dwOperation, DWORD dwTimeout); DWORD icq_sendServerGroup(DWORD dwCookie, WORD wAction, WORD wGroupId, const char *szName, void *pContent, int cbContent, DWORD dwOperationFlags); - DWORD icq_modifyServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType); - DWORD icq_removeServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); - DWORD icq_addServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); + DWORD icq_modifyServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType); + DWORD icq_removeServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); + DWORD icq_addServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); int __cdecl ServListDbSettingChanged(WPARAM wParam, LPARAM lParam); int __cdecl ServListDbContactDeleted(WPARAM wParam, LPARAM lParam); @@ -697,11 +697,11 @@ struct CIcqProto : public PROTO void icq_setidle(int bAllow); void icq_setstatus(WORD wStatus, const char *szStatusNote = NULL); - DWORD icq_sendGetInfoServ(HCONTACT hContact, DWORD, int); - DWORD icq_sendGetAimProfileServ(HCONTACT hContact, char *szUid); - DWORD icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD, int, WORD); - DWORD icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion); - DWORD icq_sendGetAimAwayMsgServ(HCONTACT hContact, char *szUID, int type); + DWORD icq_sendGetInfoServ(MCONTACT hContact, DWORD, int); + DWORD icq_sendGetAimProfileServ(MCONTACT hContact, char *szUid); + DWORD icq_sendGetAwayMsgServ(MCONTACT hContact, DWORD, int, WORD); + DWORD icq_sendGetAwayMsgServExt(MCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion); + DWORD icq_sendGetAimAwayMsgServ(MCONTACT hContact, char *szUID, int type); void icq_sendSetAimAwayMsgServ(const char *szMsg); void icq_sendFileSendServv7(filetransfer* ft, const char *szFiles); @@ -719,7 +719,7 @@ struct CIcqProto : public PROTO void icq_sendGenericContact(DWORD dwUin, const char *szUid, WORD wFamily, WORD wSubType); void icq_sendNewContact(DWORD dwUin, const char *szUid); void icq_sendRemoveContact(DWORD dwUin, const char *szUid); - void icq_sendChangeVisInvis(HCONTACT hContact, DWORD dwUin, char* szUID, int list, int add); + void icq_sendChangeVisInvis(MCONTACT hContact, DWORD dwUin, char* szUID, int list, int add); void icq_sendEntireVisInvisList(int); void icq_sendAwayMsgReplyServ(DWORD, DWORD, DWORD, WORD, WORD, BYTE, char **); void icq_sendAwayMsgReplyServExt(DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wCookie, WORD wVersion, BYTE msgType, char **szMsg); @@ -737,11 +737,11 @@ struct CIcqProto : public PROTO void sendOwnerInfoRequest(void); DWORD sendUserInfoMultiRequest(BYTE *pRequestData, WORD wDataLen, int nItems); - DWORD icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hContact, char *pszText, cookie_message_data *pCookieData); - DWORD icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData); // UTF-16 - DWORD icq_SendChannel2Message(DWORD dwUin, HCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); - DWORD icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData); - DWORD icq_SendChannel4Message(DWORD dwUin, HCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData); + DWORD icq_SendChannel1Message(DWORD dwUin, char *szUID, MCONTACT hContact, char *pszText, cookie_message_data *pCookieData); + DWORD icq_SendChannel1MessageW(DWORD dwUin, char *szUID, MCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData); // UTF-16 + DWORD icq_SendChannel2Message(DWORD dwUin, MCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); + DWORD icq_SendChannel2Contacts(DWORD dwUin, char *szUid, MCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData); + DWORD icq_SendChannel4Message(DWORD dwUin, MCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData); void icq_sendAdvancedMsgAck(DWORD, DWORD, DWORD, WORD, BYTE, BYTE); void icq_sendContactsAck(DWORD dwUin, char *szUid, DWORD dwMsgID1, DWORD dwMsgID2); @@ -766,10 +766,10 @@ struct CIcqProto : public PROTO void oft_sendFileRedirect(DWORD dwUin, char *szUid, oscar_filetransfer *ft, DWORD dwIP, WORD wPort, int bProxy); //---- | icq_svcs.cpp |---------------------------------------------------------------- - HCONTACT AddToListByUIN(DWORD dwUin, DWORD dwFlags); - HCONTACT AddToListByUID(const char *szUID, DWORD dwFlags); + MCONTACT AddToListByUIN(DWORD dwUin, DWORD dwFlags); + MCONTACT AddToListByUID(const char *szUID, DWORD dwFlags); - void ICQAddRecvEvent(HCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags); + void ICQAddRecvEvent(MCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags); INT_PTR __cdecl IcqAddCapability(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl IcqCheckCapability(WPARAM wParam, LPARAM lParam); @@ -788,22 +788,22 @@ struct CIcqProto : public PROTO HGENMENU hXStatusItems[XSTATUS_COUNT + 1]; void InitXStatusItems(BOOL bAllowStatus); - BYTE getContactXStatus(HCONTACT hContact); - DWORD sendXStatusDetailsRequest(HCONTACT hContact, int bForced); - DWORD requestXStatusDetails(HCONTACT hContact, BOOL bAllowDelay); + BYTE getContactXStatus(MCONTACT hContact); + DWORD sendXStatusDetailsRequest(MCONTACT hContact, int bForced); + DWORD requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay); HICON getXStatusIcon(int bStatus, UINT flags); void setXStatusEx(BYTE bXStatus, BYTE bQuiet); - void handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize); + void handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize); void updateServerCustomStatus(int fullUpdate); //----| icq_xtraz.cpp |--------------------------------------------------------------- void handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC); - void handleXtrazNotifyResponse(DWORD dwUin, HCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen); + void handleXtrazNotifyResponse(DWORD dwUin, MCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen); void handleXtrazInvitation(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC); void handleXtrazData(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC); - DWORD SendXtrazNotifyRequest(HCONTACT hContact, char* szQuery, char* szNotify, int bForced); + DWORD SendXtrazNotifyRequest(MCONTACT hContact, char* szQuery, char* szNotify, int bForced); void SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szResponse, int nResponseLen, BOOL bThruDC); //----| init.cpp |-------------------------------------------------------------------- @@ -821,12 +821,12 @@ struct CIcqProto : public PROTO filetransfer *CreateIcqFileTransfer(); void ReleaseFileTransfer(void *ft); void SafeReleaseFileTransfer(void **ft); - oscar_filetransfer* FindOscarTransfer(HCONTACT hContact, DWORD dwID1, DWORD dwID2); + oscar_filetransfer* FindOscarTransfer(MCONTACT hContact, DWORD dwID1, DWORD dwID2); oscar_listener* CreateOscarListener(oscar_filetransfer *ft, NETLIBNEWCONNECTIONPROC_V2 handler); void ReleaseOscarListener(oscar_listener **pListener); - void OpenOscarConnection(HCONTACT hContact, oscar_filetransfer *ft, int type); + void OpenOscarConnection(MCONTACT hContact, oscar_filetransfer *ft, int type); void CloseOscarConnection(oscar_connection *oc); int CreateOscarProxyConnection(oscar_connection *oc); @@ -837,10 +837,10 @@ struct CIcqProto : public PROTO void handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand); void handleRecvServResponseOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, void* ft); - HANDLE oftInitTransfer(HCONTACT hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription); - HANDLE oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - DWORD oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); - DWORD oftFileCancel(HCONTACT hContact, HANDLE hTransfer); + HANDLE oftInitTransfer(MCONTACT hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription); + HANDLE oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + DWORD oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + DWORD oftFileCancel(MCONTACT hContact, HANDLE hTransfer); void oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename); void sendOscarPacket(oscar_connection *oc, icq_packet *packet); @@ -864,17 +864,17 @@ struct CIcqProto : public PROTO int StringToListItemId(const char *szSetting,int def); //----| utilities.cpp |--------------------------------------------------------------- - char* ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg); + char* ConvertMsgToUserSpecificAnsi(MCONTACT hContact, const char* szMsg); char* GetUserStoredPassword(char *szBuffer, int cbSize); char* GetUserPassword(BOOL bAlways); WORD GetMyStatusFlags(); - DWORD ReportGenericSendError(HCONTACT hContact, int nType, const char* szErrorMsg); + DWORD ReportGenericSendError(MCONTACT hContact, int nType, const char* szErrorMsg); void SetCurrentStatus(int nStatus); void __cdecl ProtocolAckThread(icq_ack_args* pArguments); - void SendProtoAck(HCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage); + void SendProtoAck(MCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage); int NetLog_Direct(const char *fmt,...); int NetLog_Uni(BOOL bDC, const char *fmt,...); @@ -882,8 +882,8 @@ struct CIcqProto : public PROTO icq_critical_section *contactsCacheMutex; LIST contactsCache; - void AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid); - void DeleteFromContactsCache(HCONTACT hContact); + void AddToContactsCache(MCONTACT hContact, DWORD dwUin, const char *szUid); + void DeleteFromContactsCache(MCONTACT hContact); void InitContactsCache(); void UninitContactsCache(); @@ -892,38 +892,38 @@ struct CIcqProto : public PROTO HANDLE NetLib_BindPort(NETLIBNEWCONNECTIONPROC_V2 pFunc, void* lParam, WORD* pwPort, DWORD* pdwIntIP); - HCONTACT HandleFromCacheByUid(DWORD dwUin, const char *szUid); - HCONTACT HContactFromUIN(DWORD dwUin, int *Added); - HCONTACT HContactFromUID(DWORD dwUin, const char *szUid, int *Added); - HCONTACT HContactFromAuthEvent(HANDLE hEvent); + MCONTACT HandleFromCacheByUid(DWORD dwUin, const char *szUid); + MCONTACT HContactFromUIN(DWORD dwUin, int *Added); + MCONTACT HContactFromUID(DWORD dwUin, const char *szUid, int *Added); + MCONTACT HContactFromAuthEvent(HANDLE hEvent); void ResetSettingsOnListReload(); void ResetSettingsOnConnect(); void ResetSettingsOnLoad(); - int IsMetaInfoChanged(HCONTACT hContact); + int IsMetaInfoChanged(MCONTACT hContact); char *setStatusNoteText, *setStatusMoodData; void __cdecl SetStatusNoteThread(void *pArguments); int SetStatusNote(const char *szStatusNote, DWORD dwDelay, int bForced); int SetStatusMood(const char *szMoodData, DWORD dwDelay); - BOOL writeDbInfoSettingString(HCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength); - BOOL writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength); - BOOL writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); - BOOL writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength); - BOOL writeDbInfoSettingByteWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingString(MCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength); + BOOL writeDbInfoSettingWord(MCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingWordWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingByte(MCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingByteWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); - void writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVDate(HCONTACT hContact, const char *szSettingYear, const char *szSettingMonth, const char *szSettingDay, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVStringUtf(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVWord(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVByte(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVDouble(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVDate(MCONTACT hContact, const char *szSettingYear, const char *szSettingMonth, const char *szSettingDay, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVBlob(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); char** MirandaStatusToAwayMsg(int nStatus); - bool validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType); + bool validateStatusMessageRequest(MCONTACT hContact, WORD byMessageType); }; #endif diff --git a/protocols/IcqOscarJ/src/icq_rates.h b/protocols/IcqOscarJ/src/icq_rates.h index 7583bf9cb7..60c7ad6769 100644 --- a/protocols/IcqOscarJ/src/icq_rates.h +++ b/protocols/IcqOscarJ/src/icq_rates.h @@ -108,7 +108,7 @@ public: virtual void execute(); - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; char *szUid; }; diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 3de47b821b..e5691b1215 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -192,7 +192,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam) StopAvatarThread(); // Offline all contacts - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { DWORD dwUIN; diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index df7fdc753f..e103094c57 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -463,7 +463,7 @@ void CIcqProto::servlistProcessLogin() #define SPOF_AUTO_CREATE_ITEM 0x01 -int CIcqProto::servlistPendingFindItem(int nType, HCONTACT hContact, const char *pszGroup) +int CIcqProto::servlistPendingFindItem(int nType, MCONTACT hContact, const char *pszGroup) { if (servlistPendingList) for (int i = 0; i < servlistPendingCount; i++) @@ -489,7 +489,7 @@ void CIcqProto::servlistPendingAddItem(servlistpendingitem *pItem) } -servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup) +servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, MCONTACT hContact, const char *pszGroup) { // unregister pending item, trigger pending operations int iItem; servlistpendingitem *pItem = NULL; @@ -546,7 +546,7 @@ servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HCONTACT hC } -void CIcqProto::servlistPendingAddContactOperation(HCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags) +void CIcqProto::servlistPendingAddContactOperation(MCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags) { // add postponed operation (add contact, update contact, regroup resume, etc.) // - after contact is added int iItem; @@ -599,7 +599,7 @@ void CIcqProto::servlistPendingAddGroupOperation(const char *pszGroup, LPARAM pa } -int CIcqProto::servlistPendingAddContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam, PENDING_CONTACT_CALLBACK operationCallback) +int CIcqProto::servlistPendingAddContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam, PENDING_CONTACT_CALLBACK operationCallback) { int iItem; servlistpendingitem *pItem = NULL; @@ -700,7 +700,7 @@ int CIcqProto::servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPAR } -void CIcqProto::servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult) +void CIcqProto::servlistPendingRemoveContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult) { #ifdef _DEBUG debugLogA("Server-List: %s contact %x operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", hContact); @@ -800,14 +800,14 @@ void CIcqProto::servlistPendingFlushOperations() // used for adding new contacts to list - sync with visible items -void CIcqProto::AddJustAddedContact(HCONTACT hContact) +void CIcqProto::AddJustAddedContact(MCONTACT hContact) { icq_lock l(servlistMutex); if (nJustAddedCount >= nJustAddedSize) { nJustAddedSize += 10; - pdwJustAddedList = (HCONTACT*)SAFE_REALLOC(pdwJustAddedList, nJustAddedSize * sizeof(HCONTACT)); + pdwJustAddedList = (MCONTACT*)SAFE_REALLOC(pdwJustAddedList, nJustAddedSize * sizeof(MCONTACT)); } pdwJustAddedList[nJustAddedCount] = hContact; @@ -816,7 +816,7 @@ void CIcqProto::AddJustAddedContact(HCONTACT hContact) // was the contact added during this serv-list load -BOOL CIcqProto::IsContactJustAdded(HCONTACT hContact) +BOOL CIcqProto::IsContactJustAdded(MCONTACT hContact) { icq_lock l(servlistMutex); @@ -975,7 +975,7 @@ void CIcqProto::LoadServerIDs() nGroups = nServerIDListCount - nStart; - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { // search all our contacts, reserve their server IDs @@ -1147,7 +1147,7 @@ DWORD CIcqProto::icq_sendServerItem(DWORD dwCookie, WORD wAction, WORD wGroupId, } -DWORD CIcqProto::icq_sendServerContact(HCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject) +DWORD CIcqProto::icq_sendServerContact(MCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject) { DWORD dwUin; uid_str szUid; @@ -1286,7 +1286,7 @@ DWORD CIcqProto::icq_sendServerGroup(DWORD dwCookie, WORD wAction, WORD wGroupId } -DWORD CIcqProto::icq_modifyServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType) +DWORD CIcqProto::icq_modifyServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType) { cookie_servlist_action *ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action)); DWORD dwCookie; @@ -1306,13 +1306,13 @@ DWORD CIcqProto::icq_modifyServerPrivacyItem(HCONTACT hContact, DWORD dwUin, cha } -DWORD CIcqProto::icq_removeServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) +DWORD CIcqProto::icq_removeServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) { return icq_modifyServerPrivacyItem(hContact, dwUin, szUid, ICQ_LISTS_REMOVEFROMLIST, SSA_PRIVACY_REMOVE, wItemId, wType); } -DWORD CIcqProto::icq_addServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) +DWORD CIcqProto::icq_addServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) { return icq_modifyServerPrivacyItem(hContact, dwUin, szUid, ICQ_LISTS_ADDTOLIST, SSA_PRIVACY_ADD, wItemId, wType); } @@ -1360,7 +1360,7 @@ void* CIcqProto::collectBuddyGroup(WORD wGroupID, int *count) { WORD* buf = NULL; int cnt = 0; - HCONTACT hContact; + MCONTACT hContact; WORD wItemID; hContact = FindFirstContact(); @@ -1395,7 +1395,7 @@ void* CIcqProto::collectGroups(int *count) WORD* buf = NULL; int cnt = 0; int i; - HCONTACT hContact; + MCONTACT hContact; WORD wGroupID; hContact = FindFirstContact(); @@ -1578,7 +1578,7 @@ int CIcqProto::getCListGroupExists(const char *szGroup) } -int CIcqProto::moveContactToCListGroup(HCONTACT hContact, const char *szGroup) +int CIcqProto::moveContactToCListGroup(MCONTACT hContact, const char *szGroup) { HANDLE hGroup = Clist_CreateGroup(0, ptrT( mir_utf8decodeT(szGroup))); @@ -2009,7 +2009,7 @@ int CIcqProto::servlistAddContact_gotGroup(const char *szGroup, WORD wGroupID, L // Need to be called when Pending Contact is active -int CIcqProto::servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult) +int CIcqProto::servlistAddContact_Ready(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult) { cookie_servlist_action* ack = (cookie_servlist_action*)lParam; @@ -2039,7 +2039,7 @@ int CIcqProto::servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD // Called when contact should be added to server list, if group does not exist, create one -void CIcqProto::servlistAddContact(HCONTACT hContact, const char *pszGroup) +void CIcqProto::servlistAddContact(MCONTACT hContact, const char *pszGroup) { DWORD dwUin; uid_str szUid; @@ -2068,7 +2068,7 @@ void CIcqProto::servlistAddContact(HCONTACT hContact, const char *pszGroup) } -int CIcqProto::servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) +int CIcqProto::servlistRemoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) { WORD wGroupID; WORD wItemID; @@ -2115,7 +2115,7 @@ int CIcqProto::servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WO // Called when contact should be removed from server list, remove group if it remain empty -void CIcqProto::servlistRemoveContact(HCONTACT hContact) +void CIcqProto::servlistRemoveContact(MCONTACT hContact) { DWORD dwUin; uid_str szUid; @@ -2201,7 +2201,7 @@ int CIcqProto::servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNew } -int CIcqProto::servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) +int CIcqProto::servlistMoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) { cookie_servlist_action *ack = (cookie_servlist_action*)lParam; @@ -2233,7 +2233,7 @@ int CIcqProto::servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD // Called when contact should be moved from one group to another, create new, remove empty -void CIcqProto::servlistMoveContact(HCONTACT hContact, const char *pszNewGroup) +void CIcqProto::servlistMoveContact(MCONTACT hContact, const char *pszNewGroup) { DWORD dwUin; uid_str szUid; @@ -2277,7 +2277,7 @@ void CIcqProto::servlistMoveContact(HCONTACT hContact, const char *pszNewGroup) } -int CIcqProto::servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) +int CIcqProto::servlistUpdateContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) { cookie_servlist_action *ack = (cookie_servlist_action*)lParam; @@ -2326,7 +2326,7 @@ int CIcqProto::servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WO // Is called when a contact' details has been changed locally to update // the server side details. -void CIcqProto::servlistUpdateContact(HCONTACT hContact) +void CIcqProto::servlistUpdateContact(MCONTACT hContact) { DWORD dwUin; uid_str szUid; @@ -2533,7 +2533,7 @@ void CIcqProto::servlistRemoveGroup(const char *szGroup, WORD wGroupId) }*/ -void CIcqProto::resetServContactAuthState(HCONTACT hContact, DWORD dwUin) +void CIcqProto::resetServContactAuthState(MCONTACT hContact, DWORD dwUin) { WORD wContactId = getWord(hContact, DBSETTING_SERVLIST_ID, 0); WORD wGroupId = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0); @@ -2593,14 +2593,14 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam) if (!strcmpnull(cws->szSetting, "MyHandle") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) { // Update contact's details in server-list - servlistUpdateContact((HCONTACT)wParam); + servlistUpdateContact((MCONTACT)wParam); } // Has contact been moved to another group? if (!strcmpnull(cws->szSetting, "Group") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) { // Read group from DB - char* szNewGroup = getContactCListGroup((HCONTACT)wParam); + char* szNewGroup = getContactCListGroup((MCONTACT)wParam); SAFE_FREE(&szNewGroup); } @@ -2610,7 +2610,7 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam) if (!strcmpnull(cws->szSetting, "MyNotes") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) { // Update contact's details in server-list - servlistUpdateContact((HCONTACT)wParam); + servlistUpdateContact((MCONTACT)wParam); } } @@ -2624,17 +2624,17 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam) debugLogA("DB-Events: Contact %x deleted.", wParam); #endif - DeleteFromContactsCache((HCONTACT)wParam); + DeleteFromContactsCache((MCONTACT)wParam); if ( !icqOnline() && m_bSsiEnabled) { // contact was deleted only locally - retrieve full list on next connect - setWord((HCONTACT)wParam, "SrvRecordCount", 0); + setWord((MCONTACT)wParam, "SrvRecordCount", 0); } if ( !icqOnline() || !m_bSsiEnabled) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; // we need all server contacts on local buddy list DWORD dwUIN; @@ -2674,7 +2674,7 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam) int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; CLISTGROUPCHANGE *grpchg = (CLISTGROUPCHANGE*)lParam; if (!icqOnline() || !m_bSsiEnabled || bIsSyncingCL) diff --git a/protocols/IcqOscarJ/src/icq_servlist.h b/protocols/IcqOscarJ/src/icq_servlist.h index 3325a16538..8da1f32cf4 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.h +++ b/protocols/IcqOscarJ/src/icq_servlist.h @@ -53,12 +53,12 @@ struct CIcqProto; // callback prototypes for pending operation mechanism: typedef int (__cdecl CIcqProto::*PENDING_GROUP_CALLBACK)(const char* pszGroup, WORD wGroupId, LPARAM lParam, int nResult); -typedef int (__cdecl CIcqProto::*PENDING_CONTACT_CALLBACK)(HCONTACT hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult); +typedef int (__cdecl CIcqProto::*PENDING_CONTACT_CALLBACK)(MCONTACT hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult); // cookie struct for SSI actions struct cookie_servlist_action { - HCONTACT hContact; + MCONTACT hContact; char *szGroup; WORD wContactId; WORD wGroupId; @@ -159,7 +159,7 @@ struct servlistpendingoperation struct servlistpendingitem { int nType; - HCONTACT hContact; + MCONTACT hContact; char* szGroup; WORD wContactID; WORD wGroupID; diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index ac6b56a295..9f6a5d2080 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -62,7 +62,7 @@ static void UpdateAllContactsCheckmark(HWND hwndList, CIcqProto* ppro, HANDLE ph { int check = 1; - HCONTACT hContact = ppro->FindFirstContact(); + MCONTACT hContact = ppro->FindFirstContact(); while (hContact) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); @@ -87,7 +87,7 @@ static int UpdateCheckmarks(HWND hwndList, CIcqProto* ppro, HANDLE phItemAll) int bAll = 1; bListInit = 1; // lock CLC events - HCONTACT hContact = ppro->FindFirstContact(); + MCONTACT hContact = ppro->FindFirstContact(); while (hContact) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); @@ -112,7 +112,7 @@ static int UpdateCheckmarks(HWND hwndList, CIcqProto* ppro, HANDLE phItemAll) static void DeleteOtherContactsFromControl(HWND hCtrl, CIcqProto* ppro) { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendMessage(hCtrl, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem) if (!ppro->IsICQContact(hContact)) @@ -191,7 +191,7 @@ static DWORD sendUploadGroup(CIcqProto* ppro, WORD wAction, WORD wGroupId, char* return 0; } -static DWORD sendUploadBuddy(CIcqProto* ppro, HCONTACT hContact, WORD wAction, DWORD dwUin, char *szUID, WORD wContactId, WORD wGroupId, WORD wItemType) +static DWORD sendUploadBuddy(CIcqProto* ppro, MCONTACT hContact, WORD wAction, DWORD dwUin, char *szUID, WORD wContactId, WORD wGroupId, WORD wItemType) { DWORD dwCookie; cookie_servlist_action* ack; @@ -260,7 +260,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara static int currentSequence; static int currentAction; static int currentState; - static HCONTACT hCurrentContact; + static MCONTACT hCurrentContact; static int lastAckResult = 0; static WORD wNewContactId; static WORD wNewGroupId; @@ -511,7 +511,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara // and every time an ack from the server has been taken care of. case M_UPLOADMORE: { - HCONTACT hContact; + MCONTACT hContact; HANDLE hItem; DWORD dwUin; uid_str szUid; @@ -933,7 +933,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara case CLN_CHECKCHANGED: { NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam; - HCONTACT hContact; + MCONTACT hContact; HANDLE hItem; if (bListInit) break; diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 612b970c50..231293a139 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -42,7 +42,7 @@ int OnReloadIcons(WPARAM wParam, LPARAM lParam) return 0; } -BYTE CIcqProto::getContactXStatus(HCONTACT hContact) +BYTE CIcqProto::getContactXStatus(MCONTACT hContact) { if (!m_bXStatusEnabled && !m_bMoodsEnabled) return 0; @@ -51,7 +51,7 @@ BYTE CIcqProto::getContactXStatus(HCONTACT hContact) return (bXStatus < 1 || bXStatus > XSTATUS_COUNT) ? 0 : bXStatus; } -DWORD CIcqProto::sendXStatusDetailsRequest(HCONTACT hContact, int bForced) +DWORD CIcqProto::sendXStatusDetailsRequest(MCONTACT hContact, int bForced) { DWORD dwCookie = 0; @@ -67,7 +67,7 @@ DWORD CIcqProto::sendXStatusDetailsRequest(HCONTACT hContact, int bForced) return dwCookie; } -DWORD CIcqProto::requestXStatusDetails(HCONTACT hContact, BOOL bAllowDelay) +DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay) { if (!validateStatusMessageRequest(hContact, MTYPE_SCRIPT_NOTIFY)) return 0; // apply privacy rules @@ -169,7 +169,7 @@ HICON CIcqProto::getXStatusIcon(int bStatus, UINT flags) return (flags & LR_SHARED || !icon) ? icon : CopyIcon(icon); } -void setContactExtraIcon(HCONTACT hContact, int xstatus) +void setContactExtraIcon(MCONTACT hContact, int xstatus) { ExtraIcon_SetIcon(hExtraXStatus, hContact, (xstatus > 0) ? hXStatusIcons[xstatus-1] : NULL); } @@ -393,7 +393,7 @@ const int moodXStatus[XSTATUS_COUNT] = { 81, 84}; -void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize) +void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize) { int bChanged = FALSE; int nCustomStatusID = 0, nMoodID = 0; @@ -579,7 +579,7 @@ struct SetXStatusData CIcqProto* ppro; BYTE bAction; BYTE bXStatus; - HCONTACT hContact; + MCONTACT hContact; HANDLE hEvent; DWORD iEvent; int countdown; @@ -593,7 +593,7 @@ struct InitXStatusData BYTE bXStatus; char* szXStatusName; char* szXStatusMsg; - HCONTACT hContact; + MCONTACT hContact; }; #define HM_PROTOACK (WM_USER+10) @@ -912,7 +912,7 @@ INT_PTR CIcqProto::ShowXStatusDetails(WPARAM wParam, LPARAM lParam) InitXStatusData init; init.ppro = this; init.bAction = 1; // retrieve - init.hContact = (HCONTACT)wParam; + init.hContact = (MCONTACT)wParam; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SETXSTATUS), NULL, SetXStatusDlgProc, (LPARAM)&init); return 0; @@ -971,7 +971,7 @@ INT_PTR CIcqProto::SetXStatusEx(WPARAM wParam, LPARAM lParam) INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam) { CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!m_bXStatusEnabled && !m_bMoodsEnabled) return 1; @@ -1088,7 +1088,7 @@ INT_PTR CIcqProto::GetXStatusIcon(WPARAM wParam, LPARAM lParam) INT_PTR CIcqProto::RequestXStatusDetails(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!m_bXStatusEnabled) return 0; @@ -1105,7 +1105,7 @@ INT_PTR CIcqProto::RequestAdvStatusIconIdx(WPARAM wParam, LPARAM lParam) if (!m_bXStatusEnabled && !m_bMoodsEnabled) return -1; - BYTE bXStatus = getContactXStatus((HCONTACT)wParam); + BYTE bXStatus = getContactXStatus((MCONTACT)wParam); if (bXStatus) { if (!bXStatusCListIconsValid[bXStatus-1]) { // adding icon int idx = hXStatusCListIcons[bXStatus-1]; diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index 68bf447e3f..ff4d2a543f 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -35,7 +35,7 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w char *szNotify = strstrnull(szMsg, ""); char *szQuery = strstrnull(szMsg, ""); - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); if (hContact) // user sent us xtraz, he supports it SetContactCapabilities(hContact, CAPF_XTRAZ); @@ -174,7 +174,7 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w } -void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, HCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen) +void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, MCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen) { char *szMem, *szRes, *szEnd; int nResLen; @@ -294,7 +294,7 @@ static char* getXmlPidItem(const char* szData, int nLen) void CIcqProto::handleXtrazInvitation(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC) { - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); if (hContact) // user sent us xtraz, he supports it SetContactCapabilities(hContact, CAPF_XTRAZ); @@ -310,7 +310,7 @@ void CIcqProto::handleXtrazInvitation(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WO void CIcqProto::handleXtrazData(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC) { - HCONTACT hContact; + MCONTACT hContact; char* szPluginID; hContact = HContactFromUIN(dwUin, NULL); @@ -367,7 +367,7 @@ void CIcqProto::handleXtrazData(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCo // Functions really sending Xtraz stuff -DWORD CIcqProto::SendXtrazNotifyRequest(HCONTACT hContact, char* szQuery, char* szNotify, int bForced) +DWORD CIcqProto::SendXtrazNotifyRequest(MCONTACT hContact, char* szQuery, char* szNotify, int bForced) { char *szQueryBody; char *szNotifyBody; @@ -409,9 +409,9 @@ void CIcqProto::SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2, char *szResBody = MangleXml(szResponse, nResponseLen); int nBodyLen = strlennull(szResBody) + 21; char *szBody = (char*)_alloca(nBodyLen); - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) { + if (hContact != INVALID_CONTACT_ID && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) { SAFE_FREE(&szResBody); return; // Contact does not support xtraz, do not send anything } diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index d8b59e2ff4..69df16b526 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -38,12 +38,12 @@ INT_PTR CIcqProto::AddServerContact(WPARAM wParam, LPARAM lParam) if (!m_bSsiEnabled) return 0; // Does this contact have a UID? - if (!getContactUid((HCONTACT)wParam, &dwUin, &szUid) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_IGNORE, 0)) + if (!getContactUid((MCONTACT)wParam, &dwUin, &szUid) && !getWord((MCONTACT)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((MCONTACT)wParam, DBSETTING_SERVLIST_IGNORE, 0)) { /// TODO: remove possible 0x6A TLV in contact server-list data!!! // Read group from DB - char *pszGroup = getContactCListGroup((HCONTACT)wParam); + char *pszGroup = getContactCListGroup((MCONTACT)wParam); - servlistAddContact((HCONTACT)wParam, pszGroup); + servlistAddContact((MCONTACT)wParam, pszGroup); SAFE_FREE((void**)&pszGroup); } return 0; @@ -88,7 +88,7 @@ INT_PTR CIcqProto::GetInfoSetting(WPARAM wParam, LPARAM lParam) { DBCONTACTGETSETTING *cgs = (DBCONTACTGETSETTING*)lParam; BYTE type = cgs->pValue->type; - INT_PTR rc = db_get_s((HCONTACT)wParam, cgs->szModule, cgs->szSetting, cgs->pValue, 0); + INT_PTR rc = db_get_s((MCONTACT)wParam, cgs->szModule, cgs->szSetting, cgs->pValue, 0); if (rc) return rc; @@ -458,13 +458,13 @@ INT_PTR CIcqProto::GrantAuthorization(WPARAM wParam, LPARAM lParam) DWORD dwUin; uid_str szUid; - if (getContactUid((HCONTACT)wParam, &dwUin, &szUid)) + if (getContactUid((MCONTACT)wParam, &dwUin, &szUid)) return 0; // Invalid contact // send without reason, do we need any ? icq_sendGrantAuthServ(dwUin, szUid, NULL); // auth granted, remove contact menu item - delSetting((HCONTACT)wParam, "Grant"); + delSetting((MCONTACT)wParam, "Grant"); } return 0; @@ -494,7 +494,7 @@ INT_PTR CIcqProto::RevokeAuthorization(WPARAM wParam, LPARAM lParam) DWORD dwUin; uid_str szUid; - if (getContactUid((HCONTACT)wParam, &dwUin, &szUid)) + if (getContactUid((MCONTACT)wParam, &dwUin, &szUid)) return 0; // Invalid contact if (MessageBox(NULL, TranslateT("Are you sure you want to revoke user's authorization?\nThis will remove you from his/her list on some clients."), TranslateT("Confirmation"), MB_ICONQUESTION | MB_YESNO) != IDYES) @@ -633,10 +633,10 @@ INT_PTR CIcqProto::SetPassword(WPARAM wParam, LPARAM lParam) // TODO: Adding needs some more work in general -HCONTACT CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) +MCONTACT CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) { int bAdded; - HCONTACT hContact = HContactFromUIN(dwUin, &bAdded); + MCONTACT hContact = HContactFromUIN(dwUin, &bAdded); if (hContact) { if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0)) @@ -652,10 +652,10 @@ HCONTACT CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) } -HCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) +MCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) { int bAdded; - HCONTACT hContact = HContactFromUID(0, szUID, &bAdded); + MCONTACT hContact = HContactFromUID(0, szUID, &bAdded); if (hContact) { if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0)) @@ -673,7 +673,7 @@ HCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) ///////////////////////////////////////////////////////////////////////////////////////// -void CIcqProto::ICQAddRecvEvent(HCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags) +void CIcqProto::ICQAddRecvEvent(MCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags) { if (pre->flags & PREF_CREATEREAD) flags |= DBEF_READ; @@ -714,7 +714,7 @@ INT_PTR __cdecl CIcqProto::IcqCheckCapability(WPARAM wParam, LPARAM lParam) { int res = 0; DBVARIANT dbvariant; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; ICQ_CUSTOMCAP *icqCustomCap = (ICQ_CUSTOMCAP *)lParam; db_get(hContact, m_szModuleName, "CapBuf", &dbvariant); diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index b9d112dff3..5643c5ceae 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -33,7 +33,7 @@ struct oscarthreadstartinfo { int type; int incoming; - HCONTACT hContact; + MCONTACT hContact; HANDLE hConnection; DWORD dwRemoteIP; oscar_filetransfer *ft; @@ -171,7 +171,7 @@ int CIcqProto::IsValidOscarTransfer(void *ft) } -oscar_filetransfer* CIcqProto::FindOscarTransfer(HCONTACT hContact, DWORD dwID1, DWORD dwID2) +oscar_filetransfer* CIcqProto::FindOscarTransfer(MCONTACT hContact, DWORD dwID1, DWORD dwID2) { icq_lock l(oftMutex); @@ -377,7 +377,7 @@ void CIcqProto::ReleaseOscarListener(oscar_listener **pListener) void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand) { - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (wCommand == 0) { // this is OFT request @@ -559,7 +559,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz } } int bAdded; - HCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); ft->hContact = hContact; ft->fileId = -1; @@ -838,7 +838,7 @@ static char *oftGetFileContainer(oscar_filetransfer* oft, const char** files, in } -HANDLE CIcqProto::oftInitTransfer(HCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc) +HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc) { int i, filesCount; struct _stati64 statbuf; @@ -992,7 +992,7 @@ HANDLE CIcqProto::oftInitTransfer(HCONTACT hContact, DWORD dwUin, char* szUid, c } -HANDLE CIcqProto::oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath) +HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath) { oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer; DWORD dwUin; @@ -1025,7 +1025,7 @@ HANDLE CIcqProto::oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR } -DWORD CIcqProto::oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason) +DWORD CIcqProto::oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason) { oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer; DWORD dwUin; @@ -1054,7 +1054,7 @@ DWORD CIcqProto::oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *s } -DWORD CIcqProto::oftFileCancel(HCONTACT hContact, HANDLE hTransfer) +DWORD CIcqProto::oftFileCancel(MCONTACT hContact, HANDLE hTransfer) { oscar_filetransfer* ft = (oscar_filetransfer*)hTransfer; DWORD dwUin; @@ -1231,7 +1231,7 @@ void CIcqProto::CloseOscarConnection(oscar_connection *oc) ///////////////////////////////////////////////////////////////////////////////////////// -void CIcqProto::OpenOscarConnection(HCONTACT hContact, oscar_filetransfer *ft, int type) +void CIcqProto::OpenOscarConnection(MCONTACT hContact, oscar_filetransfer *ft, int type) { oscarthreadstartinfo *otsi = (oscarthreadstartinfo*)SAFE_MALLOC(sizeof(oscarthreadstartinfo)); diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.h b/protocols/IcqOscarJ/src/oscar_filetransfer.h index bf4162b50b..36a7c738de 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.h +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.h @@ -62,7 +62,7 @@ char *FindFilePathContainer(const char **files, int iFile, char *szContainer); struct oscar_filetransfer: public basic_filetransfer { - HCONTACT hContact; + MCONTACT hContact; int flags; // combination of OFTF_* int containerCount; char **file_containers; @@ -123,7 +123,7 @@ void SafeReleaseFileTransfer(void **ft); struct oscar_connection { - HCONTACT hContact; + MCONTACT hContact; HANDLE hConnection; int status; DWORD dwUin; diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index eb36b3277c..a502a09005 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -310,7 +310,7 @@ void CIcqProto::icq_setstatus(WORD wStatus, const char *szStatusNote) } -DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hContact, char *pszText, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, MCONTACT hContact, char *pszText, cookie_message_data *pCookieData) { icq_packet packet; WORD wPacketLength; @@ -355,7 +355,7 @@ DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hCon } -DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, MCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData) { icq_packet packet; WORD wMessageLen; @@ -405,7 +405,7 @@ DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hCo } -DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HCONTACT hContact, const char *szMessage, int nBodyLen, WORD wPriority, cookie_message_data *pCookieData, char *szCap) +DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, MCONTACT hContact, const char *szMessage, int nBodyLen, WORD wPriority, cookie_message_data *pCookieData, char *szCap) { icq_packet packet; @@ -433,7 +433,7 @@ DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HCONTACT hContact, const c } -DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, MCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData) { icq_packet packet; @@ -462,7 +462,7 @@ DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT hCo } -DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, HCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, MCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData) { icq_packet packet; WORD wPacketLength; @@ -552,7 +552,7 @@ DWORD CIcqProto::sendUserInfoMultiRequest(BYTE *pRequestData, WORD wDataLen, int } -DWORD CIcqProto::icq_sendGetInfoServ(HCONTACT hContact, DWORD dwUin, int bManual) +DWORD CIcqProto::icq_sendGetInfoServ(MCONTACT hContact, DWORD dwUin, int bManual) { icq_packet packet; DWORD dwCookie = 0; @@ -607,7 +607,7 @@ DWORD CIcqProto::icq_sendGetInfoServ(HCONTACT hContact, DWORD dwUin, int bManual } -DWORD CIcqProto::icq_sendGetAimProfileServ(HCONTACT hContact, char* szUid) +DWORD CIcqProto::icq_sendGetAimProfileServ(MCONTACT hContact, char* szUid) { icq_packet packet; BYTE bUIDlen = strlennull(szUid); @@ -632,7 +632,7 @@ DWORD CIcqProto::icq_sendGetAimProfileServ(HCONTACT hContact, char* szUid) } -DWORD CIcqProto::icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD dwUin, int type, WORD wVersion) +DWORD CIcqProto::icq_sendGetAwayMsgServ(MCONTACT hContact, DWORD dwUin, int type, WORD wVersion) { icq_packet packet; @@ -650,7 +650,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD dwUin, int type } -DWORD CIcqProto::icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion) +DWORD CIcqProto::icq_sendGetAwayMsgServExt(MCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion) { icq_packet packet; @@ -684,7 +684,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char } -DWORD CIcqProto::icq_sendGetAimAwayMsgServ(HCONTACT hContact, char *szUID, int type) +DWORD CIcqProto::icq_sendGetAimAwayMsgServ(MCONTACT hContact, char *szUID, int type) { icq_packet packet; BYTE bUIDlen = strlennull(szUID); @@ -988,7 +988,7 @@ void CIcqProto::icq_sendFileDenyServ(DWORD dwUin, filetransfer *ft, const char * void CIcqProto::icq_sendAwayMsgReplyServ(DWORD dwUin, DWORD dwMsgID1, DWORD dwMsgID2, WORD wCookie, WORD wVersion, BYTE msgType, char** szMsg) { - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); if (validateStatusMessageRequest(hContact, msgType)) { NotifyEventHooks(m_modeMsgsEvent, (WPARAM)msgType, (LPARAM)dwUin); @@ -1032,7 +1032,7 @@ void CIcqProto::icq_sendAwayMsgReplyServ(DWORD dwUin, DWORD dwMsgID1, DWORD dwMs void CIcqProto::icq_sendAwayMsgReplyServExt(DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wCookie, WORD wVersion, BYTE msgType, char **szMsg) { - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (validateStatusMessageRequest(hContact, msgType)) { NotifyEventHooks(m_modeMsgsEvent, (WPARAM)msgType, (LPARAM)dwUin); @@ -1551,7 +1551,7 @@ void CIcqProto::icq_sendRemoveContact(DWORD dwUin, const char *szUid) // list==0: visible list // list==1: invisible list -void CIcqProto::icq_sendChangeVisInvis(HCONTACT hContact, DWORD dwUin, char* szUID, int list, int add) +void CIcqProto::icq_sendChangeVisInvis(MCONTACT hContact, DWORD dwUin, char* szUID, int list, int add) { // TODO: This needs grouping & rate management // Tell server to change our server-side contact visbility list if (m_bSsiEnabled) { diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 2c38bcd74a..deafab4806 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -340,7 +340,7 @@ BOOL CIcqProto::IsOnSpammerList(DWORD dwUIN) // ICQ contacts cache -void CIcqProto::AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid) +void CIcqProto::AddToContactsCache(MCONTACT hContact, DWORD dwUin, const char *szUid) { if (!hContact || (!dwUin && !szUid)) return; @@ -372,7 +372,7 @@ void CIcqProto::InitContactsCache() // build cache icq_lock l(contactsCacheMutex); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { DWORD dwUin; @@ -411,7 +411,7 @@ void CIcqProto::UninitContactsCache(void) } -void CIcqProto::DeleteFromContactsCache(HCONTACT hContact) +void CIcqProto::DeleteFromContactsCache(MCONTACT hContact) { icq_lock l(contactsCacheMutex); @@ -432,7 +432,7 @@ void CIcqProto::DeleteFromContactsCache(HCONTACT hContact) } -HCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid) +MCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid) { icq_contacts_cache cache_item = { NULL, dwUin, szUid }; @@ -446,11 +446,11 @@ HCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid) } -HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) +MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) { if (Added) *Added = 0; - HCONTACT hContact = HandleFromCacheByUid(dwUin, NULL); + MCONTACT hContact = HandleFromCacheByUid(dwUin, NULL); if (hContact) return hContact; @@ -469,17 +469,17 @@ HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) //not present: add if (Added) { - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (!hContact) { debugLogA("Failed to create ICQ contact %u", dwUin); - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0) { // For some reason we failed to register the protocol to this contact CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); debugLogA("Failed to register ICQ contact %u", dwUin); - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } setDword(hContact, UNIQUEIDSETTING, dwUin); @@ -505,11 +505,11 @@ HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (getContactUin(NULL) == dwUin) return NULL; - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } -HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) +MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) { if (dwUin) return HContactFromUIN(dwUin, Added); @@ -517,9 +517,9 @@ HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) if (Added) *Added = 0; if (!m_bAimEnabled) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; - HCONTACT hContact = HandleFromCacheByUid(dwUin, szUid); + MCONTACT hContact = HandleFromCacheByUid(dwUin, szUid); if (hContact) return hContact; hContact = FindFirstContact(); @@ -540,7 +540,7 @@ HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) //not present: add if (Added) { - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName); setString(hContact, UNIQUEIDSETTING, szUid); @@ -560,11 +560,11 @@ HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) return hContact; } - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } -HCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent) +MCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; DWORD body[3]; @@ -573,28 +573,28 @@ HCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent) dbei.pBlob = (PBYTE)&body; if (db_event_get(hEvent, &dbei)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (strcmpnull(dbei.szModule, m_szModuleName)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; return DbGetAuthEventContact(&dbei); } -char *NickFromHandle(HCONTACT hContact) +char *NickFromHandle(MCONTACT hContact) { - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) return null_strdup(Translate("")); return null_strdup((char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0)); } -char *NickFromHandleUtf(HCONTACT hContact) +char *NickFromHandleUtf(MCONTACT hContact) { - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) return ICQTranslateUtf(LPGEN("")); return tchar_to_utf8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); @@ -888,7 +888,7 @@ void CIcqProto::ResetSettingsOnListReload() setWord("SrvRecordCount", 0); delSetting(DBSETTING_SERVLIST_UNHANDLED); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { // All these values will be restored during the serv-list receive @@ -912,7 +912,7 @@ void CIcqProto::ResetSettingsOnConnect() setByte("SrvVisibility", 0); setDword("IdleTS", 0); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { setDword(hContact, "LogonTS", 0); @@ -933,7 +933,7 @@ void CIcqProto::ResetSettingsOnLoad() setDword("IdleTS", 0); setDword("LogonTS", 0); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { setDword(hContact, "LogonTS", 0); @@ -989,7 +989,7 @@ void __cdecl CIcqProto::ProtocolAckThread(icq_ack_args* pArguments) SAFE_FREE((void**)&pArguments); } -void CIcqProto::SendProtoAck(HCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage) +void CIcqProto::SendProtoAck(MCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage) { icq_ack_args* pArgs = (icq_ack_args*)SAFE_MALLOC(sizeof(icq_ack_args)); // This will be freed in the new thread pArgs->hContact = hContact; @@ -1010,7 +1010,7 @@ void CIcqProto::SetCurrentStatus(int nStatus) } -int CIcqProto::IsMetaInfoChanged(HCONTACT hContact) +int CIcqProto::IsMetaInfoChanged(MCONTACT hContact) { DBVARIANT infoToken = { DBVT_DELETED }; int res = 0; @@ -1250,7 +1250,7 @@ int CIcqProto::SetStatusMood(const char *szMoodData, DWORD dwDelay) } -void CIcqProto::writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVStringUtf(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { oscar_tlv *pTLV = chain->getTLV(wTlv, 1); @@ -1265,7 +1265,7 @@ void CIcqProto::writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *sz } -void CIcqProto::writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVWord(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { int num = chain->getNumber(wTlv, 1); if (num > 0) @@ -1275,7 +1275,7 @@ void CIcqProto::writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetti } -void CIcqProto::writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVByte(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { int num = chain->getNumber(wTlv, 1); @@ -1286,7 +1286,7 @@ void CIcqProto::writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetti } -void CIcqProto::writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVDouble(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { double num = chain->getDouble(wTlv, 1); if (num > 0) @@ -1295,7 +1295,7 @@ void CIcqProto::writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSet delSetting(hContact, szSetting); } -void CIcqProto::writeDbInfoSettingTLVDate(HCONTACT hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVDate(MCONTACT hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv) { double time = chain->getDouble(wTlv, 1); @@ -1320,7 +1320,7 @@ void CIcqProto::writeDbInfoSettingTLVDate(HCONTACT hContact, const char* szSetti } -void CIcqProto::writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVBlob(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { oscar_tlv *pTLV = chain->getTLV(wTlv, 1); @@ -1331,7 +1331,7 @@ void CIcqProto::writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetti } -BOOL CIcqProto::writeDbInfoSettingString(HCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingString(MCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength) { if (*pwLength < 2) return FALSE; @@ -1364,7 +1364,7 @@ BOOL CIcqProto::writeDbInfoSettingString(HCONTACT hContact, const char* szSettin return TRUE; } -BOOL CIcqProto::writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingWord(MCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength) { if (*pwLength < 2) return FALSE; @@ -1381,7 +1381,7 @@ BOOL CIcqProto::writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, return TRUE; } -BOOL CIcqProto::writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingWordWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) { if (*pwLength < 2) return FALSE; @@ -1400,7 +1400,7 @@ BOOL CIcqProto::writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *s return TRUE; } -BOOL CIcqProto::writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingByte(MCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength) { if (*pwLength < 1) return FALSE; @@ -1417,7 +1417,7 @@ BOOL CIcqProto::writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting return TRUE; } -BOOL CIcqProto::writeDbInfoSettingByteWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingByteWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) { if (*pwLength < 1) return FALSE; @@ -1450,12 +1450,12 @@ char* time2text(time_t time) } -bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType) +bool CIcqProto::validateStatusMessageRequest(MCONTACT hContact, WORD byMessageType) { // Privacy control if (getByte("StatusMsgReplyCList", 0)) { // Don't send statusmessage to unknown contacts - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) return false; // Don't send statusmessage to temporary contacts or hidden contacts @@ -1472,7 +1472,7 @@ bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageTy } // Dont send messages to people you are hiding from - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && + if (hContact != INVALID_CONTACT_ID && getWord(hContact, "ApparentMode", 0) == ID_STATUS_OFFLINE) { return false; } @@ -1487,7 +1487,7 @@ bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageTy return false; } - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && m_iStatus == ID_STATUS_INVISIBLE && + if (hContact != INVALID_CONTACT_ID && m_iStatus == ID_STATUS_INVISIBLE && getWord(hContact, "ApparentMode", 0) != ID_STATUS_ONLINE) { if (!getByte(hContact, "TemporaryVisible", 0)) { // Allow request to temporary visible contacts return false; @@ -1904,7 +1904,7 @@ int MessageBoxUtf(HWND hWnd, const char *szText, const char *szCaption, UINT uTy return res; } -char* CIcqProto::ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg) +char* CIcqProto::ConvertMsgToUserSpecificAnsi(MCONTACT hContact, const char* szMsg) { // this takes utf-8 encoded message WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage); char* szAnsi = NULL; @@ -1917,7 +1917,7 @@ char* CIcqProto::ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szM } // just broadcast generic send error with dummy cookie and return that cookie -DWORD CIcqProto::ReportGenericSendError(HCONTACT hContact, int nType, const char* szErrorMsg) +DWORD CIcqProto::ReportGenericSendError(MCONTACT hContact, int nType, const char* szErrorMsg) { DWORD dwCookie = GenerateCookie(0); SendProtoAck(hContact, dwCookie, ACKRESULT_FAILED, nType, Translate(szErrorMsg)); diff --git a/protocols/IcqOscarJ/src/utilities.h b/protocols/IcqOscarJ/src/utilities.h index c229feac2a..b9f063ee74 100644 --- a/protocols/IcqOscarJ/src/utilities.h +++ b/protocols/IcqOscarJ/src/utilities.h @@ -33,7 +33,7 @@ struct icq_ack_args { - HCONTACT hContact; + MCONTACT hContact; int nAckType; int nAckResult; HANDLE hSequence; @@ -42,7 +42,7 @@ struct icq_ack_args struct icq_contacts_cache { - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; const char *szUid; }; @@ -66,8 +66,8 @@ void SetGatewayIndex(HANDLE hConn, DWORD dwIndex); DWORD GetGatewayIndex(HANDLE hConn); void FreeGatewayIndex(HANDLE hConn); -char *NickFromHandle(HCONTACT hContact); -char *NickFromHandleUtf(HCONTACT hContact); +char *NickFromHandle(MCONTACT hContact); +char *NickFromHandleUtf(MCONTACT hContact); char *strUID(DWORD dwUIN, char *pszUID); int __fastcall strlennull(const char *string); @@ -181,7 +181,7 @@ int ListBoxAddStringUtf(HWND hList, const char *szString); int MessageBoxUtf(HWND hWnd, const char *szText, const char *szCaption, UINT uType); void InitXStatusIcons(); -void setContactExtraIcon(HCONTACT hContact, int xstatus); +void setContactExtraIcon(MCONTACT hContact, int xstatus); int OnReloadIcons(WPARAM wParam, LPARAM lParam); #endif /* __UTILITIES_H */ -- cgit v1.2.3