diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/IcqOscarJ | |
parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (diff) |
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts
git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ')
39 files changed, 552 insertions, 603 deletions
diff --git a/protocols/IcqOscarJ/src/UI/askauthentication.cpp b/protocols/IcqOscarJ/src/UI/askauthentication.cpp index 818d5ce6de..76e290f704 100644 --- a/protocols/IcqOscarJ/src/UI/askauthentication.cpp +++ b/protocols/IcqOscarJ/src/UI/askauthentication.cpp @@ -32,7 +32,7 @@ struct AskAuthParam
{
CIcqProto* ppro;
- HANDLE hContact;
+ HCONTACT 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, (HANDLE)wParam };
+ AskAuthParam param = { this, (HCONTACT)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 04c785fc87..1c0bcb67f4 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, HANDLE hContact, char* szModule, char* szSetting, int special)
+static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, HCONTACT 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;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((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((HANDLE)lParam)) && lParam)
+ if ((!IsICQContact((HCONTACT)lParam)) && lParam)
return 0;
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
diff --git a/protocols/IcqOscarJ/src/capabilities.cpp b/protocols/IcqOscarJ/src/capabilities.cpp index e1b8b47a94..91e464b561 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(HANDLE hContact)
+void CIcqProto::ClearAllContactCapabilities(HCONTACT hContact)
{
setDword(hContact, DBSETTING_CAPABILITIES, 0);
}
// Deletes one or many oscar capabilities for a given contact
-void CIcqProto::ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
+void CIcqProto::ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities)
{
// Get current capability flags
DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
@@ -129,7 +129,7 @@ void CIcqProto::ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities) // Sets one or many oscar capabilities for a given contact
-void CIcqProto::SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
+void CIcqProto::SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities)
{
// Get current capability flags
DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
@@ -149,7 +149,7 @@ void CIcqProto::SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities) // Returns true if the given contact supports the requested capabilites
-BOOL CIcqProto::CheckContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
+BOOL CIcqProto::CheckContactCapabilities(HCONTACT 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(HANDLE hContact, BYTE *pBuffer, int nLength)
+void CIcqProto::AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength)
{
// Get current capability flags
DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
@@ -241,7 +241,7 @@ void CIcqProto::AddCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nL // Scans a binary buffer for oscar capabilities and adds them to the contact.
// You probably want to call ClearAllContactCapabilities() first.
-void CIcqProto::SetCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength, BOOL bReset)
+void CIcqProto::SetCapabilitiesFromBuffer(HCONTACT 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 36aa83c329..f5e7999a77 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, HANDLE hContact, void *pvExtra)
+DWORD CIcqProto::AllocateCookie(BYTE bType, WORD wIdent, HCONTACT hContact, void *pvExtra)
{
icq_lock l(cookieMutex);
@@ -96,13 +96,12 @@ int CIcqProto::GetCookieType(DWORD dwCookie) }
-int CIcqProto::FindCookie(DWORD dwCookie, HANDLE *phContact, void **ppvExtra)
+int CIcqProto::FindCookie(DWORD dwCookie, HCONTACT *phContact, void **ppvExtra)
{
icq_lock l(cookieMutex);
- int i = cookies.getIndex(( icq_cookie_info* )&dwCookie );
- if (i != INVALID_COOKIE_INDEX)
- {
+ int i = cookies.getIndex((icq_cookie_info*)&dwCookie);
+ if (i != INVALID_COOKIE_INDEX) {
if (phContact)
*phContact = cookies[i]->hContact;
if (ppvExtra)
@@ -116,7 +115,7 @@ int CIcqProto::FindCookie(DWORD dwCookie, HANDLE *phContact, void **ppvExtra) }
-int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HANDLE *phContact)
+int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phContact)
{
icq_lock l(cookieMutex);
@@ -138,7 +137,7 @@ int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HANDLE *phConta }
-int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HANDLE *phContact, void** ppvExtra)
+int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContact, void** ppvExtra)
{
icq_lock l(cookieMutex);
@@ -162,7 +161,7 @@ int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HANDLE *phContact, }
-int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HANDLE *phContact, cookie_message_data **ppvExtra)
+int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HCONTACT *phContact, cookie_message_data **ppvExtra)
{
icq_lock l(cookieMutex);
@@ -278,7 +277,7 @@ cookie_message_data* CIcqProto::CreateMessageCookie(WORD bMsgType, BYTE bAckType }
-cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, HANDLE hContact, DWORD dwUin, int bUseSrvRelay)
+cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, HCONTACT 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 05e0d170eb..a6017d174c 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;
- HANDLE hContact;
+ HCONTACT hContact;
void *pvExtra;
time_t dwTime;
BYTE bType;
@@ -114,7 +114,7 @@ struct cookie_search struct cookie_avatar
{
DWORD dwUin;
- HANDLE hContact;
+ HCONTACT hContact;
unsigned int hashlen;
BYTE *hash;
unsigned int cbData;
@@ -124,7 +124,7 @@ struct cookie_avatar struct cookie_reverse_connect: public cookie_message_data
{
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwUin;
int type;
void *ft;
diff --git a/protocols/IcqOscarJ/src/directpackets.cpp b/protocols/IcqOscarJ/src/directpackets.cpp index d4eb61dbc2..fa42c76c7b 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(HANDLE hContact, int type)
+DWORD CIcqProto::icq_sendGetAwayMsgDirect(HCONTACT 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(HANDLE hContact, filetransfer* ft)
+void CIcqProto::icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer* ft)
{
// v7 packet
icq_packet packet;
@@ -144,7 +144,7 @@ void CIcqProto::icq_sendFileAcceptDirect(HANDLE hContact, filetransfer* ft) }
-void CIcqProto::icq_sendFileDenyDirect(HANDLE hContact, filetransfer *ft, const char *szReason)
+void CIcqProto::icq_sendFileDenyDirect(HCONTACT 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(HANDLE hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap)
+DWORD CIcqProto::icq_SendDirectMessage(HCONTACT 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(HANDLE hContact, const char *szMessage, i return 0; // Failure
}
-void CIcqProto::icq_sendXtrazRequestDirect(HANDLE hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType)
+void CIcqProto::icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType)
{
icq_packet packet;
@@ -272,7 +272,7 @@ void CIcqProto::icq_sendXtrazRequestDirect(HANDLE hContact, DWORD dwCookie, char SendDirectMessage(hContact, &packet);
}
-void CIcqProto::icq_sendXtrazResponseDirect(HANDLE hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType)
+void CIcqProto::icq_sendXtrazResponseDirect(HCONTACT 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 3314f6bdef..a2f5ec6ac4 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, HANDLE* hContactResume)
+char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResume)
{
char* szList;
- HANDLE hContact;
+ HCONTACT hContact;
WORD wCurrentLen = 0;
DWORD dwUIN;
uid_str szUID;
@@ -611,7 +611,7 @@ char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HANDLE* hContactResume) void CIcqProto::sendEntireListServ(WORD wFamily, WORD wSubtype, int listType)
{
- HANDLE hResumeContact = NULL;
+ HCONTACT 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 e360b9dc8b..d5d6ec590a 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;
- HANDLE hCookieContact;
+ HCONTACT hCookieContact;
cookie_fam15_data *pCookieData;
@@ -101,12 +101,10 @@ static char* AimApplyEncoding(char* pszStr, const char* pszEncoding) void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie)
{
- HANDLE hContact;
DWORD dwUIN;
uid_str szUID;
WORD wTLVCount;
WORD wWarningLevel;
- HANDLE hCookieContact;
WORD status;
cookie_message_data *pCookieData;
@@ -126,33 +124,30 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie wLen -= 2;
// Determine contact
- hContact = HContactFromUID(dwUIN, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
// Ignore away status if the user is not already on our list
- if (hContact == INVALID_HANDLE_VALUE)
- {
+ if (hContact == INVALID_HANDLE_VALUE) {
#ifdef _DEBUG
debugLogA("Ignoring away reply (%s)", strUID(dwUIN, szUID));
#endif
return;
}
- if (!FindCookie(dwCookie, &hCookieContact, (void**)&pCookieData))
- {
+ HCONTACT hCookieContact;
+ if (!FindCookie(dwCookie, &hCookieContact, (void**)&pCookieData)) {
debugLogA("Error: Received unexpected away reply from %s", strUID(dwUIN, szUID));
return;
}
- if (hContact != hCookieContact)
- {
+ if (hContact != hCookieContact) {
debugLogA("Error: Away reply Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
return;
}
- switch (GetCookieType(dwCookie))
- {
+ switch (GetCookieType(dwCookie)) {
case CKT_FAMILYSPECIAL:
{
ReleaseCookie(dwCookie);
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 94f5e1c930..d443919e6c 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -196,7 +196,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info) wLen -= 2;
// Ignore status notification if the user is not already on our list
- HANDLE hContact = HContactFromUID(dwUIN, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
if (hContact == INVALID_HANDLE_VALUE)
{
#ifdef _DEBUG
@@ -618,7 +618,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen) }
// Determine contact
- HANDLE hContact = HContactFromUID(dwUIN, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
// Skip contacts that are not already on our list or are already offline
if (hContact != INVALID_HANDLE_VALUE)
@@ -666,7 +666,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen) }
-void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HANDLE hContact, oscar_tlv_chain *pChain)
+void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HCONTACT 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 ed84dad0dc..bd53d9c045 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(HANDLE hContact, const char *szMsg)
+char* CIcqProto::convertMsgToUserSpecificUtf(HCONTACT 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;
- HANDLE hContact = HContactFromUID(dwUin, szUID, &bAdded);
+ HCONTACT 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
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (wCommand == 1)
{
@@ -575,7 +575,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * unpackLEDWord(&buf, &dwUin);
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT hContact = HContactFromUIN(dwUin, NULL);
if (hContact == INVALID_HANDLE_VALUE)
{
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, HANDLE hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType)
+void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType)
{
WORD wId;
@@ -886,7 +886,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D }
-void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE 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, HCONTACT 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, HANDLE hCont void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand)
{
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (wCommand == 0)
{ // received contacts
@@ -1231,10 +1231,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha else if (wCommand == 2)
{ // acknowledgement
DWORD dwCookie;
- HANDLE hCookieContact;
-
- if (FindMessageCookie(dwID1, dwID2, &dwCookie, &hCookieContact, NULL))
- {
+ HCONTACT 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);
@@ -1242,8 +1240,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha ReleaseCookie(dwCookie);
}
- else
- debugLogA("Warning: Unexpected Contact Transfer ack from %s", strUID(dwUin, szUID));
+ else debugLogA("Warning: Unexpected Contact Transfer ack from %s", strUID(dwUin, szUID));
}
}
@@ -1622,7 +1619,7 @@ void packPluginTypeId(icq_packet *packet, int nTypeID) }
-void CIcqProto::handleStatusMsgReply(const char *szPrefix, HANDLE hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags)
+void CIcqProto::handleStatusMsgReply(const char *szPrefix, HCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags)
{
if (hContact == INVALID_HANDLE_VALUE) {
debugLogA("%sIgnoring status message from unknown contact %u", szPrefix, dwUin);
@@ -1652,10 +1649,10 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD {
if (bFlags == 3)
{
- HANDLE hCookieContact;
+ HCONTACT hCookieContact;
cookie_message_data *pCookieData = NULL;
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData))
{
@@ -1687,7 +1684,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD /* this function send all acks from handleMessageTypes */
-void CIcqProto::sendMessageTypesAck(HANDLE hContact, int bUnicode, message_ack_params *pArgs)
+void CIcqProto::sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs)
{
if (pArgs)
{
@@ -1712,7 +1709,7 @@ void CIcqProto::sendMessageTypesAck(HANDLE hContact, int bUnicode, message_ack_p /* 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)
{
- HANDLE hContact = INVALID_HANDLE_VALUE;
+ HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
BOOL bThruDC = (nMsgFlags & MTF_DIRECT) == MTF_DIRECT;
int bAdded;
@@ -2189,7 +2186,6 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d WORD bMsgType = 0;
BYTE bFlags;
WORD wLength;
- HANDLE hCookieContact;
DWORD dwMsgID1, dwMsgID2;
WORD wVersion = 0;
cookie_message_data *pCookieData = NULL;
@@ -2209,40 +2205,38 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return;
- HANDLE hContact = HContactFromUID(dwUin, szUid, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL);
buf += 2; // 3. unknown
wLen -= 2;
- if (!FindMessageCookie(dwMsgID1, dwMsgID2, &dwCookie, &hCookieContact, &pCookieData))
- {
+ HCONTACT 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;
}
- if (IsValidOscarTransfer(pCookieData))
- { // it is OFT response
+ if (IsValidOscarTransfer(pCookieData)) {
+ // it is OFT response
handleRecvServResponseOFT(buf, wLen, dwUin, szUid, pCookieData);
return;
}
- if (!dwUin)
- { // AIM cannot send this - just sanity
+ if (!dwUin) {
+ // AIM cannot send this - just sanity
debugLogA("Error: Invalid UID in message response.");
return;
}
// Length of sub chunk?
- if (wLen >= 2)
- {
+ if (wLen >= 2) {
unpackLEWord(&buf, &wLength);
wLen -= 2;
}
- else
- wLength = 0;
+ else wLength = 0;
- if (wLength == 0x1b && pCookieData->bMessageType != MTYPE_REVERSE_REQUEST)
- { // this can be v8 greeting message reply
+ if (wLength == 0x1b && pCookieData->bMessageType != MTYPE_REVERSE_REQUEST) {
+ // this can be v8 greeting message reply
WORD wCookie;
unpackLEWord(&buf, &wVersion);
@@ -2270,8 +2264,8 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d buf += 2;
wLen -= 2;
- if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData))
- { // use old reliable method
+ if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) {
+ // use old reliable method
debugLogA("Warning: Invalid cookie in %s from (%u)", "message response", dwUin);
if (pCookieData->bMessageType != MTYPE_AUTOAWAY && bFlags == 3)
@@ -2282,8 +2276,8 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d debugLogA("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
}
}
- else if (bMsgType != MTYPE_PLUGIN && pCookieData->bMessageType != MTYPE_AUTOAWAY)
- { // just because some clients break it...
+ else if (bMsgType != MTYPE_PLUGIN && pCookieData->bMessageType != MTYPE_AUTOAWAY) {
+ // just because some clients break it...
dwCookie = wCookie;
if (bMsgType != pCookieData->bMessageType)
@@ -2291,45 +2285,35 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d bMsgType = pCookieData->bMessageType;
}
- else if (pCookieData->bMessageType == MTYPE_AUTOAWAY && bMsgType != MTYPE_PLUGIN)
- {
+ else if (pCookieData->bMessageType == MTYPE_AUTOAWAY && bMsgType != MTYPE_PLUGIN) {
if (bMsgType != pCookieData->nAckType)
debugLogA("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
}
}
- else
- {
+ else {
bMsgType = pCookieData->bMessageType;
bFlags = 0;
}
- if (hCookieContact != hContact)
- {
+ if (hCookieContact != hContact) {
debugLogA("SNAC(4.B) Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
-
ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
return;
}
if (bFlags == 3) // A status message reply
- {
handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, wVersion, bMsgType, (WORD)dwCookie, (char*)(buf + 2), 0);
- }
- else
- { // An ack of some kind
+ else {
+ // An ack of some kind
int ackType;
-
- if (hContact == NULL || hContact == INVALID_HANDLE_VALUE)
- {
+ if (hContact == NULL || hContact == INVALID_HANDLE_VALUE) {
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;
}
switch (bMsgType) {
-
case MTYPE_FILEREQ:
{
char* szMsg;
@@ -2340,8 +2324,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d wLen -= 2;
szMsg = (char *)_alloca(wMsgLen + 1);
szMsg[wMsgLen] = '\0';
- if (wMsgLen > 0)
- {
+ if (wMsgLen > 0) {
memcpy(szMsg, buf, wMsgLen);
buf += wMsgLen;
wLen -= wMsgLen;
@@ -2361,8 +2344,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d WORD wFunctionId;
- if (wLength != 0x1B)
- {
+ if (wLength != 0x1B) {
debugLogA("Invalid Greeting %s", "message response");
ReleaseCookie(dwCookie);
@@ -2378,22 +2360,18 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d wLen -= wMsgLen;
// This packet is malformed. Possibly a file accept from Miranda IM 0.1.2.1
- if (wLen < 20)
- {
+ if (wLen < 20) {
ReleaseCookie(dwCookie);
return;
}
- if (!unpackPluginTypeId(&buf, &wLen, &typeId, &wFunctionId, FALSE))
- {
+ if (!unpackPluginTypeId(&buf, &wLen, &typeId, &wFunctionId, FALSE)) {
ReleaseCookie(dwCookie);
return;
}
- if (wLen < 4)
- {
+ if (wLen < 4) {
debugLogA("Error: Invalid greeting %s", "message response");
-
ReleaseCookie(dwCookie);
return;
}
@@ -2407,12 +2385,10 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d else
dwDataLen = 0;
-
- switch (typeId)
- {
+ switch (typeId) {
case MTYPE_PLAIN:
- if (pCookieData && pCookieData->bMessageType == MTYPE_AUTOAWAY && dwLengthToEnd >= 4)
- { // ICQ 6 invented this
+ if (pCookieData && pCookieData->bMessageType == MTYPE_AUTOAWAY && dwLengthToEnd >= 4) {
+ // ICQ 6 invented this
char *szMsg = (char*)_alloca(dwDataLen + 1);
if (dwDataLen > 0)
@@ -2423,8 +2399,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d ReleaseCookie(dwCookie);
return;
}
- else
- ackType = ACKTYPE_MESSAGE;
+ ackType = ACKTYPE_MESSAGE;
break;
case MTYPE_URL:
@@ -2436,9 +2411,8 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d break;
case MTYPE_FILEREQ:
+ debugLogA("This is file ack");
{
- debugLogA("This is file ack");
-
char *szMsg = (char *)_alloca(dwDataLen + 1);
if (dwDataLen > 0)
@@ -2537,21 +2511,18 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d }
if ((ackType == MTYPE_PLAIN && pCookieData && (pCookieData->nAckType == ACKTYPE_CLIENT)) || ackType != MTYPE_PLAIN)
- {
ProtoBroadcastAck(hContact, ackType, ACKRESULT_SUCCESS, (HANDLE)(WORD)dwCookie, 0);
- }
}
ReleaseCookie(dwCookie);
}
-
// A response to a CLI_SENDMSG
void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSequence)
{
WORD wError;
char *pszErrorMessage;
- HANDLE hContact;
+ HCONTACT hContact;
cookie_message_data *pCookieData = NULL;
int nMessageType;
@@ -2559,13 +2530,13 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD if (wLen < 2)
return;
- if (FindCookie((WORD)dwSequence, &hContact, (void**)&pCookieData))
- { // all packet cookies from msg family has command 0 in the queue
+ if (FindCookie((WORD)dwSequence, &hContact, (void**)&pCookieData)) {
+ // all packet cookies from msg family has command 0 in the queue
DWORD dwUin;
uid_str szUid;
- if (getContactUid(hContact, &dwUin, &szUid))
- { // Invalid contact
+ if (getContactUid(hContact, &dwUin, &szUid)) {
+ // Invalid contact
FreeCookie((WORD)dwSequence);
return;
}
@@ -2573,8 +2544,8 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD // Error code
unpackWord(&buf, &wError);
- if (wError == 9 && pCookieData->bMessageType == MTYPE_AUTOAWAY)
- { // we failed to request away message the normal way, try it AIM way
+ if (wError == 9 && pCookieData->bMessageType == MTYPE_AUTOAWAY) {
+ // we failed to request away message the normal way, try it AIM way
icq_packet packet;
serverPacketInit(&packet, (WORD)(13 + getUINLen(dwUin)));
@@ -2589,7 +2560,6 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD // Not all of these are actually used in family 4
// This will be moved into a special error handling function later
switch (wError) {
-
case 0x0002: // Server rate limit exceeded
pszErrorMessage = Translate("You are sending too fast. Wait a while and try again.\r\nSNAC(4.1) Error x02");
break;
@@ -2599,10 +2569,9 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD break;
case 0x0004: // Recipient is not logged in (resend in a offline message)
- if (pCookieData->bMessageType == MTYPE_PLAIN)
- {
- if (pCookieData->isOffline)
- { // offline failed - most probably to AIM contact
+ if (pCookieData->bMessageType == MTYPE_PLAIN) {
+ if (pCookieData->isOffline) {
+ // offline failed - most probably to AIM contact
pszErrorMessage = Translate("The contact does not support receiving offline messages.");
break;
}
@@ -2683,23 +2652,17 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD }
if (nMessageType != -1)
- {
ProtoBroadcastAck(hContact, nMessageType, ACKRESULT_FAILED, (HANDLE)(WORD)dwSequence, (LPARAM)pszErrorMessage);
- }
else
- {
debugLogA("Error: Message delivery to %u failed: %s", dwUin, pszErrorMessage);
- }
FreeCookie((WORD)dwSequence);
if (pCookieData->bMessageType != MTYPE_FILEREQ)
SAFE_FREE((void**)&pCookieData);
}
- else
- {
+ else {
unpackWord(&buf, &wError);
-
LogFamilyError(ICQ_MSG_FAMILY, wError);
}
}
@@ -2712,9 +2675,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque WORD wChannel;
cookie_message_data *pCookieData;
-
- if (wLen < 13)
- {
+ if (wLen < 13) {
debugLogA("Ignoring SNAC(4,C) Packet to short");
return;
}
@@ -2729,7 +2690,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque // Sender
if (!unpackUID(&buf, &wLen, &dwUin, &szUID)) return;
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (FindCookie((WORD)dwSequence, NULL, (void**)&pCookieData))
{
@@ -2928,7 +2889,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR // Sender
if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return;
- HANDLE hContact = HContactFromUID(dwUin, szUid, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL);
if (hContact == INVALID_HANDLE_VALUE) return;
@@ -2973,7 +2934,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR }
-void CIcqProto::sendTypingNotification(HANDLE hContact, WORD wMTNCode)
+void CIcqProto::sendTypingNotification(HCONTACT 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 882ded41aa..203ba13b00 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(HANDLE hContact)
+void CIcqProto::makeContactTemporaryVisible(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUid;
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 049d3c1cab..fa83b408cd 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) }
-HANDLE CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded)
+HCONTACT CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded)
{
- HANDLE hContact = INVALID_HANDLE_VALUE;
+ HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
if (!IsStringUIN(szRecordName))
{ // probably AIM contact
@@ -904,7 +904,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server case SSI_ITEM_BUDDY:
{
/* this is a contact */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1172,7 +1172,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* item on visible list */
/* wItemId not related to contact ID */
/* pszRecordName is the UIN */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1211,7 +1211,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* Item on invisible list */
/* wItemId not related to contact ID */
/* pszRecordName is the UIN */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1269,7 +1269,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* item on ignore list */
/* wItemId not related to contact ID */
/* pszRecordName is the UIN */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1471,7 +1471,7 @@ void CIcqProto::handleServerCListItemAdd(const char *szRecordName, WORD wGroupId void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData)
{
- HANDLE hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
+ HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
if (hContact != INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
{ // a contact was updated on server
@@ -1586,7 +1586,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData)
{
- HANDLE hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
+ HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
if (hContact != INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
{ // a contact was removed from our list
@@ -1632,7 +1632,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen) if (wReasonLen > wLen)
return;
- HANDLE hContact = HContactFromUID(dwUin, szUid, &bAdded);
+ HCONTACT 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;
}
- HANDLE hContact = HContactFromUID(dwUin, szUid, &bAdded);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded);
cbBlob=sizeof(DWORD)*2+4;
@@ -1782,7 +1782,7 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen) return;
}
- HANDLE hContact = HContactFromUID(dwUin, szUid, &bAdded);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded);
if (hContact != INVALID_HANDLE_VALUE) szNick = NickFromHandle(hContact);
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 327e6cbc35..78759c03d8 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)
{
- HANDLE hContact;
+ HCONTACT hContact;
cookie_fam15_data *pCookieData = NULL;
int foundCookie = FindCookie(wCookie, &hContact, (void**)&pCookieData);
@@ -578,7 +578,7 @@ UserInfoRecordItem rInterest[] = { };
-int CIcqProto::parseUserInfoRecord(HANDLE hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords)
+int CIcqProto::parseUserInfoRecord(HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
// check request cookie
if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData)
{
@@ -843,7 +843,7 @@ static int calcAgeFromBirthDate(double dDate) }
-void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType)
+void CIcqProto::parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType)
{
oscar_tlv *pTLV;
WORD wRecordCount;
@@ -1152,7 +1152,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO }
cookie_directory_data *pCookieData;
- HANDLE hContact;
+ HCONTACT 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 f5eb6ce4e0..a8eba258f9 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(HANDLE hContact, const BYTE *pHash, int nHashLen)
+int CIcqProto::IsAvatarChanged(HCONTACT 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, HANDLE hContact, BYTE *pHash, int nHashLen, WORD wOldStatus)
+void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus)
{
int bJob = FALSE;
BOOL avatarInfoPresent = FALSE;
@@ -696,7 +696,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac // request avatar data from server
-int CIcqProto::GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file)
+int CIcqProto::GetAvatarData(HCONTACT 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(HANDLE hContact, DWORD dwUin, const char *szUid, co // upload avatar data to server
-int CIcqProto::SetAvatarData(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen)
+int CIcqProto::SetAvatarData(HCONTACT 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(HANDLE hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file)
+DWORD avatars_server_connection::sendGetAvatarRequest(HCONTACT 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(HANDLE hContact, DWORD dwU }
-DWORD avatars_server_connection::sendUploadAvatarRequest(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen)
+DWORD avatars_server_connection::sendUploadAvatarRequest(HCONTACT 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 26d805d397..e989640d93 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.h +++ b/protocols/IcqOscarJ/src/icq_avatar.h @@ -85,8 +85,8 @@ public: __inline BOOL isPending() { return !isLoggedIn; };
__inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; };
- DWORD sendGetAvatarRequest(HANDLE hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file);
- DWORD sendUploadAvatarRequest(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen);
+ 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);
};
__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;
- HANDLE hContact;
+ HCONTACT 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 c836b16e3c..2ea61ae5e2 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(HANDLE hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient,
+const char* CIcqProto::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, /* 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 8841ce24fc..c54d389a53 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(HANDLE hContact, const char *szSetting, DBVARIANT *dbv)
+int CIcqProto::getSetting(HCONTACT hContact, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, m_szModuleName, szSetting, dbv, 0);
}
-double CIcqProto::getSettingDouble(HANDLE hContact, const char *szSetting, double dDef)
+double CIcqProto::getSettingDouble(HCONTACT hContact, const char *szSetting, double dDef)
{
DBVARIANT dbv = {DBVT_DELETED};
double dRes;
@@ -51,12 +51,12 @@ double CIcqProto::getSettingDouble(HANDLE hContact, const char *szSetting, doubl return dRes;
}
-DWORD CIcqProto::getContactUin(HANDLE hContact)
+DWORD CIcqProto::getContactUin(HCONTACT hContact)
{
return getDword(hContact, UNIQUEIDSETTING, 0);
}
-int CIcqProto::getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid)
+int CIcqProto::getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid)
{
DBVARIANT dbv = {DBVT_DELETED};
int iRes = 1;
@@ -82,7 +82,7 @@ int CIcqProto::getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid) return iRes;
}
-char* CIcqProto::getSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, char *szDef)
+char* CIcqProto::getSettingStringUtf(HCONTACT 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(HANDLE hContact, const char *szModule, cons return szRes;
}
-char* CIcqProto::getSettingStringUtf(HANDLE hContact, const char *szSetting, char *szDef)
+char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szSetting, char *szDef)
{
return getSettingStringUtf(hContact, m_szModuleName, szSetting, szDef);
}
-WORD CIcqProto::getContactStatus(HANDLE hContact)
+WORD CIcqProto::getContactStatus(HCONTACT hContact)
{
return getWord(hContact, "Status", ID_STATUS_OFFLINE);
}
-int CIcqProto::getSettingStringStatic(HANDLE hContact, const char *szSetting, char *dest, int dest_len)
+int CIcqProto::getSettingStringStatic(HCONTACT 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(HANDLE hContact, const char *szSetting, ch return db_get_static_utf(hContact, m_szModuleName, szSetting, dest, dest_len);
}
-int CIcqProto::setSettingDouble(HANDLE hContact, const char *szSetting, double dValue)
+int CIcqProto::setSettingDouble(HCONTACT hContact, const char *szSetting, double dValue)
{
return setSettingBlob(hContact, szSetting, (BYTE*)&dValue, sizeof(double));
}
-int CIcqProto::setSettingBlob(HANDLE hContact, const char *szSetting, const BYTE *pValue, const int cbValue)
+int CIcqProto::setSettingBlob(HCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue)
{
return db_set_blob(hContact, m_szModuleName, szSetting, (void*)pValue, cbValue);
}
-int CIcqProto::setContactHidden(HANDLE hContact, BYTE bHidden)
+int CIcqProto::setContactHidden(HCONTACT hContact, BYTE bHidden)
{
int nResult = db_set_b(hContact, "CList", "Hidden", bHidden);
if (!bHidden) // clear zero setting
@@ -132,7 +132,7 @@ int CIcqProto::setContactHidden(HANDLE hContact, BYTE bHidden) return nResult;
}
-void CIcqProto::setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi)
+void CIcqProto::setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAnsi)
{
if (szStatusMsg && szStatusMsg[0]) {
if (isAnsi) {
@@ -171,14 +171,14 @@ void CIcqProto::setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi) else db_unset(hContact, "CList", "StatusMsg");
}
-int CIcqProto::IsICQContact(HANDLE hContact)
+int CIcqProto::IsICQContact(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
return !strcmpnull(szProto, m_szModuleName);
}
-HANDLE CIcqProto::AddEvent(HANDLE hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob)
+HANDLE CIcqProto::AddEvent(HCONTACT 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(HANDLE hContact, WORD wType, DWORD dwTime, DWORD flag return db_event_add(hContact, &dbei);
}
-HANDLE CIcqProto::FindFirstContact()
+HCONTACT CIcqProto::FindFirstContact()
{
- HANDLE hContact = db_find_first(m_szModuleName);
+ HCONTACT hContact = db_find_first(m_szModuleName);
if (IsICQContact(hContact))
return hContact;
@@ -200,7 +200,7 @@ HANDLE CIcqProto::FindFirstContact() return FindNextContact(hContact);
}
-HANDLE CIcqProto::FindNextContact(HANDLE hContact)
+HCONTACT CIcqProto::FindNextContact(HCONTACT hContact)
{
hContact = db_find_next(hContact, m_szModuleName);
while (hContact != NULL)
@@ -212,7 +212,7 @@ HANDLE CIcqProto::FindNextContact(HANDLE hContact) return hContact;
}
-char* CIcqProto::getContactCListGroup(HANDLE hContact)
+char* CIcqProto::getContactCListGroup(HCONTACT hContact)
{
return getSettingStringUtf(hContact, "CList", "Group", NULL);
}
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 69a610f1b4..4229777b5a 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
- HANDLE hContact; // Only valid for outgoing connections
+ HCONTACT 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(HANDLE hContact)
+void CIcqProto::CloseContactDirectConns(HCONTACT hContact)
{
icq_lock l(directConnListMutex);
@@ -116,7 +116,7 @@ int CIcqProto::sendDirectPacket(directconnect* dc, icq_packet* pkt) return nResult;
}
-directthreadstartinfo* CreateDTSI(HANDLE hContact, HANDLE hConnection, int type)
+directthreadstartinfo* CreateDTSI(HCONTACT hContact, HANDLE hConnection, int type)
{
directthreadstartinfo* dtsi = (directthreadstartinfo*)SAFE_MALLOC(sizeof(directthreadstartinfo));
dtsi->hContact = hContact;
@@ -131,7 +131,7 @@ directthreadstartinfo* CreateDTSI(HANDLE hContact, HANDLE hConnection, int type) // Check if we have an open and initialized DC with type
// 'type' to the specified contact
-BOOL CIcqProto::IsDirectConnectionOpen(HANDLE hContact, int type, int bPassive)
+BOOL CIcqProto::IsDirectConnectionOpen(HCONTACT 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(HANDLE hContact, int type, void* pvExtra)
+void CIcqProto::OpenDirectConnection(HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
if (wLen != 0x30)
{
@@ -1009,7 +1009,7 @@ int DecryptDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) }
// This should be called only if connection already exists
-int CIcqProto::SendDirectMessage(HANDLE hContact, icq_packet *pkt)
+int CIcqProto::SendDirectMessage(HCONTACT 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 3cf91cb493..76ccd0d2dc 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;
- HANDLE hContact;
+ HCONTACT hContact;
char *szFilename;
char *szDescription;
char *szSavePath;
@@ -68,7 +68,7 @@ struct filetransfer: public basic_filetransfer struct directconnect
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hConnection;
DWORD dwConnectionCookie;
int type;
diff --git a/protocols/IcqOscarJ/src/icq_directmsg.cpp b/protocols/IcqOscarJ/src/icq_directmsg.cpp index ecf9f24af6..d5a4ccdced 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
{
- HANDLE hCookieContact;
+ HCONTACT 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)
{
- HANDLE hCookieContact;
+ HCONTACT 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 2d426a5fb5..fa4c3942d1 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;
- HANDLE hCookieContact;
+ HCONTACT 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(HANDLE hContact, DWORD dwUin, int nVersion)
+filetransfer* CIcqProto::CreateFileTransfer(HCONTACT 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;
- HANDLE hContact = HContactFromUIN(dwUin, &bAdded);
+ HCONTACT 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(HANDLE hContact, filetransfer* ft)
+void CIcqProto::icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft)
{
DWORD dwCookie;
diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp index 58ed0ec592..969607b6be 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(HANDLE hContact)
+BOOL CIcqProto::icq_QueueUser(HCONTACT hContact)
{
if ( !infoUpdateMutex )
return FALSE;
@@ -155,7 +155,7 @@ void CIcqProto::icq_RescanInfoUpdate() bInfoUpdateEnabled = 0; // freeze thread
// Queue all outdated users
- HANDLE hContact = FindFirstContact();
+ HCONTACT 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 93e85a6965..5538103a41 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<CIcqProto> g_Instances(1, sttCompareProtocols);
-static CIcqProto* IcqGetInstanceByHContact(HANDLE hContact)
+static CIcqProto* IcqGetInstanceByHContact(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -54,37 +54,37 @@ static CIcqProto* IcqGetInstanceByHContact(HANDLE hContact) static INT_PTR IcqMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->RequestAuthorization(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->GrantAuthorization(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleRevokeAuth(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->RevokeAuthorization(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleAddServContact(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->AddServerContact(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleXStatusDetails(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->ShowXStatusDetails(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleOpenProfile(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)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((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->OnPreBuildContactMenu(wParam, lParam) : 0;
}
@@ -177,7 +177,7 @@ void g_MenuUninit(void) INT_PTR CIcqProto::OpenWebProfile(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -197,18 +197,18 @@ int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM) DWORD dwUin = getContactUin(hContact);
Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_REQUEST],
- dwUin && (bCtrlPressed || (getByte((HANDLE)wParam, "Auth", 0) && getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0))));
- Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_GRANT], dwUin && (bCtrlPressed || getByte((HANDLE)wParam, "Grant", 0)));
+ dwUin && (bCtrlPressed || (getByte(hContact, "Auth", 0) && getWord(hContact, DBSETTING_SERVLIST_ID, 0))));
+ Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_GRANT], dwUin && (bCtrlPressed || getByte(hContact, "Grant", 0)));
Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_REVOKE],
- dwUin && (bCtrlPressed || (getByte("PrivacyItems", 0) && !getByte((HANDLE)wParam, "Grant", 0))));
+ dwUin && (bCtrlPressed || (getByte("PrivacyItems", 0) && !getByte(hContact, "Grant", 0))));
Menu_ShowItem(g_hContactMenuItems[ICMI_ADD_TO_SERVLIST],
- m_bSsiEnabled && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) &&
- !getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0) &&
+ m_bSsiEnabled && !getWord(hContact, DBSETTING_SERVLIST_ID, 0) &&
+ !getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0) &&
!db_get_b(hContact, "CList", "NotOnList", 0));
}
Menu_ShowItem(g_hContactMenuItems[ICMI_OPEN_PROFILE],getContactUin(hContact) != 0);
- BYTE bXStatus = getContactXStatus((HANDLE)wParam);
+ BYTE bXStatus = getContactXStatus(hContact);
Menu_ShowItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], m_bHideXStatusUI ? 0 : bXStatus != 0);
if (bXStatus && !m_bHideXStatusUI) {
diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp index fdaa77cb30..ba3572b61f 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(HANDLE hContact, const char *szTitle, const char *szMsg, BYTE bType)
+int CIcqProto::ShowPopupMsg(HCONTACT 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 e23420b326..d347223323 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);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact != NULL) {
DWORD bXStatus = getContactXStatus(hContact);
if (bXStatus > 0)
@@ -420,7 +420,7 @@ HANDLE __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEv int CIcqProto::Authorize(HANDLE hDbEvent)
{
if (icqOnline() && hDbEvent) {
- HANDLE hContact = HContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -446,7 +446,7 @@ int CIcqProto::Authorize(HANDLE hDbEvent) int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
{
if (icqOnline() && hDbEvent) {
- HANDLE hContact = HContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -470,7 +470,7 @@ int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) ////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CIcqProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CIcqProto::AuthRecv(HCONTACT 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(HANDLE hContact, PROTORECVEVENT* pre) ////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CIcqProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
+int __cdecl CIcqProto::AuthRequest(HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CIcqProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
{
DWORD dwUin;
uid_str szUid;
@@ -558,7 +558,7 @@ HANDLE __cdecl CIcqProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const TCH ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileCancel - cancels a file transfer
-int __cdecl CIcqProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int __cdecl CIcqProto::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
DWORD dwUin;
uid_str szUid;
@@ -588,7 +588,7 @@ int __cdecl CIcqProto::FileCancel(HANDLE hContact, HANDLE hTransfer) ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileDeny - denies a file transfer
-int __cdecl CIcqProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason)
+int __cdecl CIcqProto::FileDeny(HCONTACT 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, HANDLE hContact)
+DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HCONTACT hContact)
{
DWORD_PTR nReturn = 0;
@@ -742,7 +742,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HANDLE hContact) ////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CIcqProto::GetInfo(HANDLE hContact, int infoType)
+int __cdecl CIcqProto::GetInfo(HCONTACT hContact, int infoType)
{
if (icqOnline()) {
DWORD dwUin;
@@ -923,7 +923,7 @@ HWND __cdecl CIcqProto::SearchAdvanced(HWND hwndDlg) ////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CIcqProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CIcqProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre)
{
ICQSEARCHRESULT **isrList = (ICQSEARCHRESULT**)pre->szMessage;
int i;
@@ -974,7 +974,7 @@ int __cdecl CIcqProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre) ////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CIcqProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt)
+int __cdecl CIcqProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -983,7 +983,7 @@ int __cdecl CIcqProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt) ////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CIcqProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CIcqProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre)
{
DWORD cbBlob;
DWORD flags = 0;
@@ -1009,7 +1009,7 @@ int __cdecl CIcqProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre) ////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CIcqProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
+int __cdecl CIcqProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*)
{
return 1;
}
@@ -1018,7 +1018,7 @@ int __cdecl CIcqProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*) ////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CIcqProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int __cdecl CIcqProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
if (hContact && hContactsList) {
int i;
@@ -1289,7 +1289,7 @@ int __cdecl CIcqProto::SendContacts(HANDLE hContact, int flags, int nContacts, H ////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIcqProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CIcqProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
{
if (!icqOnline())
return 0;
@@ -1391,7 +1391,7 @@ HANDLE __cdecl CIcqProto::SendFile(HANDLE hContact, const TCHAR* szDescription, ////////////////////////////////////////////////////////////////////////////////////////
// PS_SendMessage - sends a message
-int __cdecl CIcqProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
+int __cdecl CIcqProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc)
{
if (hContact == NULL || pszSrc == NULL)
return NULL;
@@ -1581,7 +1581,7 @@ int __cdecl CIcqProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc) ////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CIcqProto::SendUrl(HANDLE hContact, int flags, const char* url)
+int __cdecl CIcqProto::SendUrl(HCONTACT hContact, int flags, const char* url)
{
if (hContact == NULL || url == NULL)
return 0;
@@ -1646,7 +1646,7 @@ int __cdecl CIcqProto::SendUrl(HANDLE hContact, int flags, const char* url) ////////////////////////////////////////////////////////////////////////////////////////
// PS_SetApparentMode - sets the visibility status
-int __cdecl CIcqProto::SetApparentMode(HANDLE hContact, int mode)
+int __cdecl CIcqProto::SetApparentMode(HCONTACT hContact, int mode)
{
DWORD uin;
uid_str uid;
@@ -1840,7 +1840,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus) struct status_message_thread_data
{
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact)
+HANDLE __cdecl CIcqProto::GetAwayMsg(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUID;
@@ -1949,7 +1949,7 @@ HANDLE __cdecl CIcqProto::GetAwayMsg(HANDLE hContact) ////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG - processes received status mode message
-int __cdecl CIcqProto::RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* evt)
+int __cdecl CIcqProto::RecvAwayMsg(HCONTACT 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(HANDLE hContact, int type)
+int __cdecl CIcqProto::UserIsTyping(HCONTACT 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 836eaafb51..9b9986d06d 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -41,7 +41,7 @@ struct userinfo
{
DWORD dwUin;
- HANDLE hContact;
+ HCONTACT hContact;
time_t queued;
};
@@ -54,50 +54,50 @@ struct CIcqProto : public PROTO<CIcqProto> // PROTO_INTERFACE
//====================================================================================
- virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr);
+ virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent);
- virtual int __cdecl Authorize( HANDLE hContact );
- virtual int __cdecl AuthDeny( HANDLE hContact, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ 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 HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
+ virtual HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData);
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason );
- virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
+ 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 int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic( const PROTOCHAR *id );
- virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR *email );
+ virtual HANDLE __cdecl SearchBasic(const PROTOCHAR *id);
+ virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR *email);
virtual HANDLE __cdecl SearchByName(const PROTOCHAR *nick, const PROTOCHAR *firstName, const PROTOCHAR *lastName);
- virtual HWND __cdecl SearchAdvanced( HWND owner );
- virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
+ virtual HWND __cdecl SearchAdvanced(HWND owner);
+ virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTORECVFILET* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ 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 SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ 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 SetApparentMode( HANDLE hContact, int mode );
- virtual int __cdecl SetStatus( int iNewStatus );
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
+ virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
- virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
- virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
+ virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
//====| Services |====================================================================
INT_PTR __cdecl AddServerContact(WPARAM wParam, LPARAM lParam);
@@ -127,22 +127,22 @@ struct CIcqProto : public PROTO<CIcqProto> INT_PTR __cdecl OnCreateAccMgrUI(WPARAM, LPARAM);
//====| Events |======================================================================
- void __cdecl OnAddContactForever( DBCONTACTWRITESETTING* cws, HANDLE hContact );
- int __cdecl OnIdleChanged( WPARAM, LPARAM );
- int __cdecl OnModernOptInit( WPARAM, LPARAM );
- int __cdecl OnModulesLoaded( WPARAM, LPARAM );
- int __cdecl OnOptionsInit( WPARAM, LPARAM );
- int __cdecl OnPreShutdown( WPARAM, LPARAM );
- int __cdecl OnPreBuildContactMenu( WPARAM, LPARAM );
- int __cdecl OnMsgUserTyping( WPARAM, LPARAM );
- int __cdecl OnProcessSrmmIconClick( WPARAM, LPARAM );
- int __cdecl OnProcessSrmmEvent( WPARAM, LPARAM );
- int __cdecl OnReloadIcons( WPARAM, LPARAM );
- void __cdecl OnRenameContact( DBCONTACTWRITESETTING* cws, HANDLE hContact );
- void __cdecl OnRenameGroup( DBCONTACTWRITESETTING* cws, HANDLE hContact );
- int __cdecl OnUserInfoInit( WPARAM, LPARAM );
-
- int __cdecl OnPreBuildStatusMenu( WPARAM, LPARAM );
+ void __cdecl OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONTACT hContact);
+ int __cdecl OnIdleChanged(WPARAM, LPARAM);
+ int __cdecl OnModernOptInit(WPARAM, LPARAM);
+ int __cdecl OnModulesLoaded(WPARAM, LPARAM);
+ int __cdecl OnOptionsInit(WPARAM, LPARAM);
+ int __cdecl OnPreShutdown(WPARAM, LPARAM);
+ int __cdecl OnPreBuildContactMenu(WPARAM, LPARAM);
+ int __cdecl OnMsgUserTyping(WPARAM, LPARAM);
+ 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);
+ int __cdecl OnUserInfoInit(WPARAM, LPARAM);
+
+ int __cdecl OnPreBuildStatusMenu(WPARAM, LPARAM);
//====| Data |========================================================================
HANDLE m_hDirectNetlibUser;
@@ -182,22 +182,22 @@ struct CIcqProto : public PROTO<CIcqProto> //----| capabilities.cpp |------------------------------------------------------------
// Deletes all oscar capabilities for a given contact.
- void ClearAllContactCapabilities(HANDLE hContact);
+ void ClearAllContactCapabilities(HCONTACT hContact);
// Deletes one or many oscar capabilities for a given contact.
- void ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities);
+ void ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities);
// Sets one or many oscar capabilities for a given contact.
- void SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities);
+ void SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities);
// Returns true if the given contact supports the requested capabilites.
- BOOL CheckContactCapabilities(HANDLE hContact, DWORD fdwCapabilities);
+ BOOL CheckContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities);
// Scans a binary buffer for oscar capabilities and adds them to the contact.
- void AddCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength);
+ void AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength);
// Scans a binary buffer for oscar capabilities and sets them to the contact.
- void SetCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength, BOOL bReset);
+ void SetCapabilitiesFromBuffer(HCONTACT 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<CIcqProto> LIST<icq_cookie_info> cookies;
WORD wCookieSeq;
- DWORD AllocateCookie(BYTE bType, WORD wIdent, HANDLE hContact, void *pvExtra);
+ DWORD AllocateCookie(BYTE bType, WORD wIdent, HCONTACT 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<CIcqProto> int GetCookieType(DWORD dwCookie);
- int FindCookie(DWORD wCookie, HANDLE *phContact, void **ppvExtra);
- int FindCookieByData(void *pvExtra, DWORD *pdwCookie, HANDLE *phContact);
- int FindCookieByType(BYTE bType, DWORD *pdwCookie, HANDLE *phContact, void **ppvExtra);
- int FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HANDLE *phContact, cookie_message_data **ppvExtra);
+ 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);
void InitMessageCookie(cookie_message_data *pCookie);
cookie_message_data* CreateMessageCookie(WORD bMsgType, BYTE bAckType);
- cookie_message_data* CreateMessageCookieData(BYTE bMsgType, HANDLE hContact, DWORD dwUin, int bUseSrvRelay);
+ cookie_message_data* CreateMessageCookieData(BYTE bMsgType, HCONTACT 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(HANDLE hContact, int type);
+ DWORD icq_sendGetAwayMsgDirect(HCONTACT hContact, int type);
void icq_sendAwayMsgReplyDirect(directconnect *dc, WORD wCookie, BYTE msgType, const char** szMsg);
- void icq_sendFileAcceptDirect(HANDLE hContact, filetransfer *ft);
- void icq_sendFileDenyDirect(HANDLE hContact, filetransfer *ft, const char *szReason);
+ void icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer *ft);
+ void icq_sendFileDenyDirect(HCONTACT 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(HANDLE hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap);
- void icq_sendXtrazRequestDirect(HANDLE hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType);
- void icq_sendXtrazResponseDirect(HANDLE hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType);
+ 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);
//----| fam_01service.cpp |-----------------------------------------------------------
void handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header *pSnacHeader, serverthread_info *info);
- char* buildUinList(int subtype, WORD wMaxLen, HANDLE *hContactResume);
+ char* buildUinList(int subtype, WORD wMaxLen, HCONTACT *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<CIcqProto> 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, HANDLE hContact, oscar_tlv_chain *pChain);
+ void parseStatusNote(DWORD dwUin, char *szUid, HCONTACT hContact, oscar_tlv_chain *pChain);
void handleNotifyRejected(BYTE *buf, WORD wPackLen);
//----| fam_04message.cpp |-----------------------------------------------------------
@@ -296,29 +296,29 @@ struct CIcqProto : public PROTO<CIcqProto> 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, HANDLE hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags);
+ void handleStatusMsgReply(const char *szPrefix, HCONTACT 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, HANDLE hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType);
- void parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE 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, 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);
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(HANDLE hContact, int bUnicode, message_ack_params *pArgs);
- void sendTypingNotification(HANDLE hContact, WORD wMTNCode);
+ void sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs);
+ void sendTypingNotification(HCONTACT hContact, WORD wMTNCode);
int unpackPluginTypeId(BYTE **pBuffer, WORD *pwLen, int *pTypeId, WORD *pFunctionId, BOOL bThruDC);
- char* convertMsgToUserSpecificUtf(HANDLE hContact, const char *szMsg);
+ char* convertMsgToUserSpecificUtf(HCONTACT 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(HANDLE hContact);
+ void makeContactTemporaryVisible(HCONTACT hContact);
//----| fam_0alookup.cpp |------------------------------------------------------------
void handleLookupFam(unsigned char *pBuffer, WORD wBufferLength, snac_header* pSnacHeader);
@@ -347,7 +347,7 @@ struct CIcqProto : public PROTO<CIcqProto> void handleRecvAuthResponse(BYTE *buf, WORD wLen);
void handleRecvAdded(BYTE *buf, WORD wLen);
- HANDLE HContactFromRecordName(const char *szRecordName, int *bAdded);
+ HCONTACT 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<CIcqProto> void handleExtensionServerInfo(BYTE *buf, WORD wPackLen, WORD wFlags);
void handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wFlags);
- int parseUserInfoRecord(HANDLE hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords);
+ int parseUserInfoRecord(HCONTACT 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(HANDLE hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType);
+ void parseDirectoryUserDetailsData(HCONTACT 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,44 +397,45 @@ struct CIcqProto : public PROTO<CIcqProto> void __cdecl AvatarThread(avatars_server_connection *pInfo);
void handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BYTE nDataLen);
- void handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContact, BYTE *pHash, int nHashLen, WORD wOldStatus);
+ void handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT 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(HANDLE hContact, const BYTE *pHash, int nHashLen);
+ int IsAvatarChanged(HCONTACT hContact, const BYTE *pHash, int nHashLen);
- int GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file);
- int SetAvatarData(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen);
+ 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);
void StartAvatarThread(HANDLE hConn, char* cookie, WORD cookieLen);
void StopAvatarThread();
//----| icq_clients.cpp |-------------------------------------------------------------
- const char* detectUserClient(HANDLE 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(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);
//----| icq_db.cpp |------------------------------------------------------------------
- HANDLE AddEvent(HANDLE hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob);
- HANDLE FindFirstContact();
- HANDLE FindNextContact(HANDLE hContact);
- int IsICQContact(HANDLE hContact);
-
- int getSetting(HANDLE hContact, const char *szSetting, DBVARIANT *dbv);
- double getSettingDouble(HANDLE hContact, const char *szSetting, double dDef);
- int getSettingStringStatic(HANDLE hContact, const char *szSetting, char *dest, int dest_len);
- char* getSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, char *szDef);
- char* getSettingStringUtf(HANDLE hContact, const char *szSetting, char *szDef);
- int getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid);
- DWORD getContactUin(HANDLE hContact);
- WORD getContactStatus(HANDLE hContact);
- char* getContactCListGroup(HANDLE hContact);
-
- int setSettingDouble(HANDLE hContact, const char *szSetting, double dValue);
- int setSettingBlob(HANDLE hContact, const char *szSetting, const BYTE *pValue, const int cbValue);
- int setContactHidden(HANDLE hContact, BYTE bHidden);
- void setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi);
+ 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);
//----| icq_direct.cpp |--------------------------------------------------------------
icq_critical_section *directConnListMutex;
@@ -452,29 +453,29 @@ struct CIcqProto : public PROTO<CIcqProto> void sendPeerFileInit(directconnect* dc);
int sendDirectPacket(directconnect* dc, icq_packet* pkt);
- void CloseContactDirectConns(HANDLE hContact);
+ void CloseContactDirectConns(HCONTACT hContact);
directconnect* FindFileTransferDC(filetransfer* ft);
filetransfer* FindExpectedFileRecv(DWORD dwUin, DWORD dwTotalSize);
- BOOL IsDirectConnectionOpen(HANDLE hContact, int type, int bPassive);
- void OpenDirectConnection(HANDLE hContact, int type, void* pvExtra);
+ BOOL IsDirectConnectionOpen(HCONTACT hContact, int type, int bPassive);
+ void OpenDirectConnection(HCONTACT hContact, int type, void* pvExtra);
void CloseDirectConnection(directconnect *dc);
- int SendDirectMessage(HANDLE hContact, icq_packet *pkt);
+ int SendDirectMessage(HCONTACT 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(HANDLE hContact, DWORD dwUin, int nVersion);
+ filetransfer* CreateFileTransfer(HCONTACT 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(HANDLE hContact, filetransfer* ft);
+ void icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft);
//----| icq_filetransfer.cpp |--------------------------------------------------------
- void icq_AcceptFileTransfer(HANDLE hContact, filetransfer *ft);
+ void icq_AcceptFileTransfer(HCONTACT hContact, filetransfer *ft);
void icq_sendFileResume(filetransfer *ft, int action, const char *szFilename);
void icq_InitFileSend(filetransfer *ft);
@@ -495,7 +496,7 @@ struct CIcqProto : public PROTO<CIcqProto> void __cdecl InfoUpdateThread(void*);
void icq_InitInfoUpdate(void); // Queues all outdated users
- BOOL icq_QueueUser(HANDLE hContact); // Queue one UIN to the list for updating
+ BOOL icq_QueueUser(HCONTACT 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
@@ -525,7 +526,7 @@ struct CIcqProto : public PROTO<CIcqProto> BOOL unpackUID(BYTE **ppBuf, WORD *pwLen, DWORD *pdwUIN, uid_str *ppszUID);
//----| icq_popups.cpp |--------------------------------------------------------------
- int ShowPopupMsg(HANDLE hContact, const char *szTitle, const char *szMsg, BYTE bType);
+ int ShowPopupMsg(HCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType);
//----| icq_proto.cpp |--------------------------------------------------------------
void __cdecl CheekySearchThread( void* );
@@ -604,15 +605,15 @@ struct CIcqProto : public PROTO<CIcqProto> int servlistPendingSize;
servlistpendingitem** servlistPendingList;
- int servlistPendingFindItem(int nType, HANDLE hContact, const char *pszGroup);
+ int servlistPendingFindItem(int nType, HCONTACT hContact, const char *pszGroup);
void servlistPendingAddItem(servlistpendingitem* pItem);
- servlistpendingitem* servlistPendingRemoveItem(int nType, HANDLE hContact, const char *pszGroup);
+ servlistpendingitem* servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup);
- void servlistPendingAddContactOperation(HANDLE hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags);
+ void servlistPendingAddContactOperation(HCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags);
void servlistPendingAddGroupOperation(const char *pszGroup, LPARAM param, PENDING_GROUP_CALLBACK callback, DWORD flags);
- int servlistPendingAddContact(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = NULL);
+ 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 servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPARAM param, PENDING_GROUP_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_GROUP_CALLBACK operationCallback = NULL);
- void servlistPendingRemoveContact(HANDLE hContact, WORD wContactID, WORD wGroupID, int nResult);
+ void servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult);
void servlistPendingRemoveGroup(const char *pszGroup, WORD wGroupID, int nResult);
void servlistPendingFlushOperations();
@@ -621,8 +622,8 @@ struct CIcqProto : public PROTO<CIcqProto> int nJustAddedSize;
HANDLE* pdwJustAddedList;
- void AddJustAddedContact(HANDLE hContact);
- BOOL IsContactJustAdded(HANDLE hContact);
+ void AddJustAddedContact(HCONTACT hContact);
+ BOOL IsContactJustAdded(HCONTACT hContact);
void FlushJustAddedContacts();
WORD GenerateServerID(int bGroupType, int bFlags, int wCount = 0);
@@ -648,18 +649,18 @@ struct CIcqProto : public PROTO<CIcqProto> 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(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult);
- void servlistAddContact(HANDLE hContact, const char *pszGroup);
+ int __cdecl servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult);
+ void servlistAddContact(HCONTACT hContact, const char *pszGroup);
- int __cdecl servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
- void servlistRemoveContact(HANDLE hContact);
+ int __cdecl servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
+ void servlistRemoveContact(HCONTACT hContact);
int __cdecl servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNewGroupID, LPARAM lParam, int nResult);
- int __cdecl servlistMoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
- void servlistMoveContact(HANDLE hContact, const char *pszNewGroup);
+ int __cdecl servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
+ void servlistMoveContact(HCONTACT hContact, const char *pszNewGroup);
- int __cdecl servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
- void servlistUpdateContact(HANDLE hContact);
+ int __cdecl servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
+ void servlistUpdateContact(HCONTACT hContact);
int __cdecl servlistRenameGroup_Ready(const char *szGroup, WORD wGroupID, LPARAM lParam, int nResult);
void servlistRenameGroup(char *szGroup, WORD wGroupId, char *szNewGroup);
@@ -670,20 +671,20 @@ struct CIcqProto : public PROTO<CIcqProto> void removeGroupPathLinks(WORD wGroupID);
int getServListGroupLevel(WORD wGroupId);
- void resetServContactAuthState(HANDLE hContact, DWORD dwUin);
+ void resetServContactAuthState(HCONTACT hContact, DWORD dwUin);
void FlushSrvGroupsCache();
int getCListGroupExists(const char *szGroup);
- int moveContactToCListGroup(HANDLE hContact, const char *szGroup); /// TODO: this should be DB function
+ int moveContactToCListGroup(HCONTACT 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(HANDLE hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, 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_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(HANDLE hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType);
- DWORD icq_removeServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType);
- DWORD icq_addServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType);
+ 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);
int __cdecl ServListDbSettingChanged(WPARAM wParam, LPARAM lParam);
int __cdecl ServListDbContactDeleted(WPARAM wParam, LPARAM lParam);
@@ -696,11 +697,11 @@ struct CIcqProto : public PROTO<CIcqProto> void icq_setidle(int bAllow);
void icq_setstatus(WORD wStatus, const char *szStatusNote = NULL);
- DWORD icq_sendGetInfoServ(HANDLE, DWORD, int);
- DWORD icq_sendGetAimProfileServ(HANDLE hContact, char *szUid);
- DWORD icq_sendGetAwayMsgServ(HANDLE, DWORD, int, WORD);
- DWORD icq_sendGetAwayMsgServExt(HANDLE hContact, DWORD dwUin, char *szUID, int type, WORD wVersion);
- DWORD icq_sendGetAimAwayMsgServ(HANDLE hContact, char *szUID, int type);
+ 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);
void icq_sendSetAimAwayMsgServ(const char *szMsg);
void icq_sendFileSendServv7(filetransfer* ft, const char *szFiles);
@@ -718,7 +719,7 @@ struct CIcqProto : public PROTO<CIcqProto> 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(HANDLE hContact, DWORD dwUin, char* szUID, int list, int add);
+ void icq_sendChangeVisInvis(HCONTACT 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);
@@ -736,11 +737,11 @@ struct CIcqProto : public PROTO<CIcqProto> void sendOwnerInfoRequest(void);
DWORD sendUserInfoMultiRequest(BYTE *pRequestData, WORD wDataLen, int nItems);
- DWORD icq_SendChannel1Message(DWORD dwUin, char *szUID, HANDLE hContact, char *pszText, cookie_message_data *pCookieData);
- DWORD icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HANDLE hContact, WCHAR *pszText, cookie_message_data *pCookieData); // UTF-16
- DWORD icq_SendChannel2Message(DWORD dwUin, HANDLE hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap);
- DWORD icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HANDLE hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData);
- DWORD icq_SendChannel4Message(DWORD dwUin, HANDLE hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData);
+ 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);
void icq_sendAdvancedMsgAck(DWORD, DWORD, DWORD, WORD, BYTE, BYTE);
void icq_sendContactsAck(DWORD dwUin, char *szUid, DWORD dwMsgID1, DWORD dwMsgID2);
@@ -768,7 +769,7 @@ struct CIcqProto : public PROTO<CIcqProto> HANDLE AddToListByUIN(DWORD dwUin, DWORD dwFlags);
HANDLE AddToListByUID(const char *szUID, DWORD dwFlags);
- void ICQAddRecvEvent(HANDLE hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags);
+ void ICQAddRecvEvent(HCONTACT 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);
@@ -787,22 +788,22 @@ struct CIcqProto : public PROTO<CIcqProto> HGENMENU hXStatusItems[XSTATUS_COUNT + 1];
void InitXStatusItems(BOOL bAllowStatus);
- BYTE getContactXStatus(HANDLE hContact);
- DWORD sendXStatusDetailsRequest(HANDLE hContact, int bForced);
- DWORD requestXStatusDetails(HANDLE hContact, BOOL bAllowDelay);
+ BYTE getContactXStatus(HCONTACT hContact);
+ DWORD sendXStatusDetailsRequest(HCONTACT hContact, int bForced);
+ DWORD requestXStatusDetails(HCONTACT hContact, BOOL bAllowDelay);
HICON getXStatusIcon(int bStatus, UINT flags);
void setXStatusEx(BYTE bXStatus, BYTE bQuiet);
- void handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYTE *caps, int capsize, char *moods, int moodsize);
+ void handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT 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, HANDLE hContact, WORD wCookie, char* szMsg, int nMsgLen);
+ void handleXtrazNotifyResponse(DWORD dwUin, HCONTACT 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(HANDLE hContact, char* szQuery, char* szNotify, int bForced);
+ DWORD SendXtrazNotifyRequest(HCONTACT 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 |--------------------------------------------------------------------
@@ -820,12 +821,12 @@ struct CIcqProto : public PROTO<CIcqProto> filetransfer *CreateIcqFileTransfer();
void ReleaseFileTransfer(void *ft);
void SafeReleaseFileTransfer(void **ft);
- oscar_filetransfer* FindOscarTransfer(HANDLE hContact, DWORD dwID1, DWORD dwID2);
+ oscar_filetransfer* FindOscarTransfer(HCONTACT hContact, DWORD dwID1, DWORD dwID2);
oscar_listener* CreateOscarListener(oscar_filetransfer *ft, NETLIBNEWCONNECTIONPROC_V2 handler);
void ReleaseOscarListener(oscar_listener **pListener);
- void OpenOscarConnection(HANDLE hContact, oscar_filetransfer *ft, int type);
+ void OpenOscarConnection(HCONTACT hContact, oscar_filetransfer *ft, int type);
void CloseOscarConnection(oscar_connection *oc);
int CreateOscarProxyConnection(oscar_connection *oc);
@@ -836,10 +837,10 @@ struct CIcqProto : public PROTO<CIcqProto> 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(HANDLE hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription);
- HANDLE oftFileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath);
- DWORD oftFileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szReason);
- DWORD oftFileCancel(HANDLE hContact, HANDLE hTransfer);
+ 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);
void oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename);
void sendOscarPacket(oscar_connection *oc, icq_packet *packet);
@@ -863,17 +864,17 @@ struct CIcqProto : public PROTO<CIcqProto> int StringToListItemId(const char *szSetting,int def);
//----| utilities.cpp |---------------------------------------------------------------
- char* ConvertMsgToUserSpecificAnsi(HANDLE hContact, const char* szMsg);
+ char* ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg);
char* GetUserStoredPassword(char *szBuffer, int cbSize);
char* GetUserPassword(BOOL bAlways);
WORD GetMyStatusFlags();
- DWORD ReportGenericSendError(HANDLE hContact, int nType, const char* szErrorMsg);
+ DWORD ReportGenericSendError(HCONTACT hContact, int nType, const char* szErrorMsg);
void SetCurrentStatus(int nStatus);
void __cdecl ProtocolAckThread(icq_ack_args* pArguments);
- void SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage);
+ void SendProtoAck(HCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage);
int NetLog_Direct(const char *fmt,...);
int NetLog_Uni(BOOL bDC, const char *fmt,...);
@@ -881,8 +882,8 @@ struct CIcqProto : public PROTO<CIcqProto> icq_critical_section *contactsCacheMutex;
LIST<icq_contacts_cache> contactsCache;
- void AddToContactsCache(HANDLE hContact, DWORD dwUin, const char *szUid);
- void DeleteFromContactsCache(HANDLE hContact);
+ void AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid);
+ void DeleteFromContactsCache(HCONTACT hContact);
void InitContactsCache();
void UninitContactsCache();
@@ -891,38 +892,38 @@ struct CIcqProto : public PROTO<CIcqProto> HANDLE NetLib_BindPort(NETLIBNEWCONNECTIONPROC_V2 pFunc, void* lParam, WORD* pwPort, DWORD* pdwIntIP);
- HANDLE HandleFromCacheByUid(DWORD dwUin, const char *szUid);
- HANDLE HContactFromUIN(DWORD dwUin, int *Added);
- HANDLE HContactFromUID(DWORD dwUin, const char *szUid, int *Added);
- HANDLE HContactFromAuthEvent(HANDLE hEvent);
+ 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);
void ResetSettingsOnListReload();
void ResetSettingsOnConnect();
void ResetSettingsOnLoad();
- int IsMetaInfoChanged(HANDLE hContact);
+ int IsMetaInfoChanged(HCONTACT 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(HANDLE hContact, const char* szSetting, char** buf, WORD* pwLength);
- BOOL writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, char **buf, WORD* pwLength);
- BOOL writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength);
- BOOL writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting, char **buf, WORD* pwLength);
- BOOL writeDbInfoSettingByteWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength);
+ 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);
- void writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVDate(HANDLE hContact, const char *szSettingYear, const char *szSettingMonth, const char *szSettingDay, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVBlob(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
+ 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);
char** MirandaStatusToAwayMsg(int nStatus);
- bool validateStatusMessageRequest(HANDLE hContact, WORD byMessageType);
+ bool validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType);
};
#endif
diff --git a/protocols/IcqOscarJ/src/icq_rates.h b/protocols/IcqOscarJ/src/icq_rates.h index ab16e74007..7583bf9cb7 100644 --- a/protocols/IcqOscarJ/src/icq_rates.h +++ b/protocols/IcqOscarJ/src/icq_rates.h @@ -108,7 +108,7 @@ public: virtual void execute();
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwUin;
char *szUid;
};
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 5084742a9c..3de47b821b 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
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact)
{
DWORD dwUIN;
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 5eac04a78b..fa866116bc 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, HANDLE hContact, const char *pszGroup)
+int CIcqProto::servlistPendingFindItem(int nType, HCONTACT 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, HANDLE hContact, const char *pszGroup)
+servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup)
{ // unregister pending item, trigger pending operations
int iItem;
servlistpendingitem *pItem = NULL;
@@ -546,7 +546,7 @@ servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HANDLE hCon }
-void CIcqProto::servlistPendingAddContactOperation(HANDLE hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags)
+void CIcqProto::servlistPendingAddContactOperation(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam, PENDING_CONTACT_CALLBACK operationCallback)
+int CIcqProto::servlistPendingAddContact(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD wGroupID, int nResult)
+void CIcqProto::servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult)
{
#ifdef _DEBUG
debugLogA("Server-List: %s contact %x operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", hContact);
@@ -800,7 +800,7 @@ void CIcqProto::servlistPendingFlushOperations() // used for adding new contacts to list - sync with visible items
-void CIcqProto::AddJustAddedContact(HANDLE hContact)
+void CIcqProto::AddJustAddedContact(HCONTACT hContact)
{
icq_lock l(servlistMutex);
@@ -816,7 +816,7 @@ void CIcqProto::AddJustAddedContact(HANDLE hContact) // was the contact added during this serv-list load
-BOOL CIcqProto::IsContactJustAdded(HANDLE hContact)
+BOOL CIcqProto::IsContactJustAdded(HCONTACT hContact)
{
icq_lock l(servlistMutex);
@@ -975,7 +975,7 @@ void CIcqProto::LoadServerIDs() nGroups = nServerIDListCount - nStart;
- HANDLE hContact = FindFirstContact();
+ HCONTACT 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(HANDLE hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject)
+DWORD CIcqProto::icq_sendServerContact(HCONTACT 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(HANDLE hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType)
+DWORD CIcqProto::icq_modifyServerPrivacyItem(HCONTACT 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(HANDLE hContact, DWORD dwUin, char }
-DWORD CIcqProto::icq_removeServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType)
+DWORD CIcqProto::icq_removeServerPrivacyItem(HCONTACT 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(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType)
+DWORD CIcqProto::icq_addServerPrivacyItem(HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
WORD wItemID;
hContact = FindFirstContact();
@@ -1395,7 +1395,7 @@ void* CIcqProto::collectGroups(int *count) WORD* buf = NULL;
int cnt = 0;
int i;
- HANDLE hContact;
+ HCONTACT hContact;
WORD wGroupID;
hContact = FindFirstContact();
@@ -1578,7 +1578,7 @@ int CIcqProto::getCListGroupExists(const char *szGroup) }
-int CIcqProto::moveContactToCListGroup(HANDLE hContact, const char *szGroup)
+int CIcqProto::moveContactToCListGroup(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistAddContact_Ready(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD w // Called when contact should be added to server list, if group does not exist, create one
-void CIcqProto::servlistAddContact(HANDLE hContact, const char *pszGroup)
+void CIcqProto::servlistAddContact(HCONTACT hContact, const char *pszGroup)
{
DWORD dwUin;
uid_str szUid;
@@ -2068,7 +2068,7 @@ void CIcqProto::servlistAddContact(HANDLE hContact, const char *pszGroup) }
-int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
{
WORD wGroupID;
WORD wItemID;
@@ -2115,7 +2115,7 @@ int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD // Called when contact should be removed from server list, remove group if it remain empty
-void CIcqProto::servlistRemoveContact(HANDLE hContact)
+void CIcqProto::servlistRemoveContact(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUid;
@@ -2201,7 +2201,7 @@ int CIcqProto::servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNew }
-int CIcqProto::servlistMoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistMoveContact_Ready(HCONTACT 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(HANDLE hContact, WORD contactID, WORD g // Called when contact should be moved from one group to another, create new, remove empty
-void CIcqProto::servlistMoveContact(HANDLE hContact, const char *pszNewGroup)
+void CIcqProto::servlistMoveContact(HCONTACT hContact, const char *pszNewGroup)
{
DWORD dwUin;
uid_str szUid;
@@ -2277,7 +2277,7 @@ void CIcqProto::servlistMoveContact(HANDLE hContact, const char *pszNewGroup) }
-int CIcqProto::servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistUpdateContact_Ready(HCONTACT 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(HANDLE hContact, WORD contactID, WORD // Is called when a contact' details has been changed locally to update
// the server side details.
-void CIcqProto::servlistUpdateContact(HANDLE hContact)
+void CIcqProto::servlistUpdateContact(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUid;
@@ -2533,7 +2533,7 @@ void CIcqProto::servlistRemoveGroup(const char *szGroup, WORD wGroupId) }*/
-void CIcqProto::resetServContactAuthState(HANDLE hContact, DWORD dwUin)
+void CIcqProto::resetServContactAuthState(HCONTACT 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((HANDLE)wParam);
+ servlistUpdateContact((HCONTACT)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((HANDLE)wParam);
+ char* szNewGroup = getContactCListGroup((HCONTACT)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((HANDLE)wParam);
+ servlistUpdateContact((HCONTACT)wParam);
}
}
@@ -2624,57 +2624,48 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam) debugLogA("DB-Events: Contact %x deleted.", wParam);
#endif
- DeleteFromContactsCache((HANDLE)wParam);
+ DeleteFromContactsCache((HCONTACT)wParam);
if ( !icqOnline() && m_bSsiEnabled)
{ // contact was deleted only locally - retrieve full list on next connect
- setWord((HANDLE)wParam, "SrvRecordCount", 0);
+ setWord((HCONTACT)wParam, "SrvRecordCount", 0);
}
if ( !icqOnline() || !m_bSsiEnabled)
return 0;
- { // we need all server contacts on local buddy list
- DWORD dwUIN;
- uid_str szUID;
+ HCONTACT hContact = (HCONTACT)wParam;
- if (getContactUid((HANDLE)wParam, &dwUIN, &szUID))
- return 0;
+ // we need all server contacts on local buddy list
+ DWORD dwUIN;
+ uid_str szUID;
+ if (getContactUid(hContact, &dwUIN, &szUID))
+ return 0;
- WORD wContactID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0);
- WORD wGroupID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_GROUP, 0);
- WORD wVisibleID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_PERMIT, 0);
- WORD wInvisibleID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_DENY, 0);
- WORD wIgnoreID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0);
+ WORD wContactID = getWord(hContact, DBSETTING_SERVLIST_ID, 0);
+ WORD wGroupID = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
+ WORD wVisibleID = getWord(hContact, DBSETTING_SERVLIST_PERMIT, 0);
+ WORD wInvisibleID = getWord(hContact, DBSETTING_SERVLIST_DENY, 0);
+ WORD wIgnoreID = getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0);
- // Remove from queue for user details request
- icq_DequeueUser(dwUIN);
+ // Remove from queue for user details request
+ icq_DequeueUser(dwUIN);
- // Close all opened peer connections
- CloseContactDirectConns((HANDLE)wParam);
+ // Close all opened peer connections
+ CloseContactDirectConns(hContact);
- if ((wGroupID && wContactID) || wVisibleID || wInvisibleID || wIgnoreID)
- {
- if (wContactID)
- { // delete contact from server
- servlistRemoveContact((HANDLE)wParam);
- }
+ if ((wGroupID && wContactID) || wVisibleID || wInvisibleID || wIgnoreID) {
+ if (wContactID) // delete contact from server
+ servlistRemoveContact(hContact);
- if (wVisibleID)
- { // detete permit record
- icq_removeServerPrivacyItem((HANDLE)wParam, dwUIN, szUID, wVisibleID, SSI_ITEM_PERMIT);
- }
+ if (wVisibleID) // detete permit record
+ icq_removeServerPrivacyItem(hContact, dwUIN, szUID, wVisibleID, SSI_ITEM_PERMIT);
- if (wInvisibleID)
- { // delete deny record
- icq_removeServerPrivacyItem((HANDLE)wParam, dwUIN, szUID, wInvisibleID, SSI_ITEM_DENY);
- }
+ if (wInvisibleID) // delete deny record
+ icq_removeServerPrivacyItem(hContact, dwUIN, szUID, wInvisibleID, SSI_ITEM_DENY);
- if (wIgnoreID)
- { // delete ignore record
- icq_removeServerPrivacyItem((HANDLE)wParam, dwUIN, szUID, wIgnoreID, SSI_ITEM_IGNORE);
- }
- }
+ if (wIgnoreID) // delete ignore record
+ icq_removeServerPrivacyItem(hContact, dwUIN, szUID, wIgnoreID, SSI_ITEM_IGNORE);
}
return 0;
@@ -2683,7 +2674,7 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam) int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 76118ce3c0..3325a16538 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)(HANDLE hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult);
+typedef int (__cdecl CIcqProto::*PENDING_CONTACT_CALLBACK)(HCONTACT hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult);
// cookie struct for SSI actions
struct cookie_servlist_action
{
- HANDLE hContact;
+ HCONTACT hContact;
char *szGroup;
WORD wContactId;
WORD wGroupId;
@@ -159,7 +159,7 @@ struct servlistpendingoperation struct servlistpendingitem
{
int nType;
- HANDLE hContact;
+ HCONTACT hContact;
char* szGroup;
WORD wContactID;
WORD wGroupID;
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index 7b4aa7d4ba..ac6b56a295 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;
- HANDLE hContact = ppro->FindFirstContact();
+ HCONTACT 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
- HANDLE hContact = ppro->FindFirstContact();
+ HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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, HANDLE hContact, WORD wAction, DWORD dwUin, char *szUID, WORD wContactId, WORD wGroupId, WORD wItemType)
+static DWORD sendUploadBuddy(CIcqProto* ppro, HCONTACT 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 HANDLE hCurrentContact;
+ static HCONTACT 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:
{
- HANDLE hContact;
+ HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hItem;
if (bListInit) break;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 946191403c..612b970c50 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(HANDLE hContact)
+BYTE CIcqProto::getContactXStatus(HCONTACT hContact)
{
if (!m_bXStatusEnabled && !m_bMoodsEnabled)
return 0;
@@ -51,7 +51,7 @@ BYTE CIcqProto::getContactXStatus(HANDLE hContact) return (bXStatus < 1 || bXStatus > XSTATUS_COUNT) ? 0 : bXStatus;
}
-DWORD CIcqProto::sendXStatusDetailsRequest(HANDLE hContact, int bForced)
+DWORD CIcqProto::sendXStatusDetailsRequest(HCONTACT hContact, int bForced)
{
DWORD dwCookie = 0;
@@ -67,7 +67,7 @@ DWORD CIcqProto::sendXStatusDetailsRequest(HANDLE hContact, int bForced) return dwCookie;
}
-DWORD CIcqProto::requestXStatusDetails(HANDLE hContact, BOOL bAllowDelay)
+DWORD CIcqProto::requestXStatusDetails(HCONTACT 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(HANDLE hContact, int xstatus)
+void setContactExtraIcon(HCONTACT 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, HANDLE hContact, BYTE *caps, int capsize, char *moods, int moodsize)
+void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hEvent;
DWORD iEvent;
int countdown;
@@ -593,7 +593,7 @@ struct InitXStatusData BYTE bXStatus;
char* szXStatusName;
char* szXStatusMsg;
- HANDLE hContact;
+ HCONTACT 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 = (HANDLE)wParam;
+ init.hContact = (HCONTACT)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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)wParam);
+ BYTE bXStatus = getContactXStatus((HCONTACT)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 58e8230804..45ff2829fe 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, "<NOTIFY>");
char *szQuery = strstrnull(szMsg, "<QUERY>");
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT 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, HANDLE hContact, WORD wCookie, char* szMsg, int nMsgLen)
+void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, HCONTACT 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)
{
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact, char* szQuery, char* szNotify, int bForced)
+DWORD CIcqProto::SendXtrazNotifyRequest(HCONTACT hContact, char* szQuery, char* szNotify, int bForced)
{
char *szQueryBody;
char *szNotifyBody;
@@ -409,7 +409,7 @@ void CIcqProto::SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2, char *szResBody = MangleXml(szResponse, nResponseLen);
int nBodyLen = strlennull(szResBody) + 21;
char *szBody = (char*)_alloca(nBodyLen);
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT hContact = HContactFromUIN(dwUin, NULL);
if (hContact != INVALID_HANDLE_VALUE && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) {
SAFE_FREE(&szResBody);
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 4b2003650d..c0077c9c89 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((HANDLE)wParam, &dwUin, &szUid) && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0))
+ if (!getContactUid((HCONTACT)wParam, &dwUin, &szUid) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_IGNORE, 0))
{ /// TODO: remove possible 0x6A TLV in contact server-list data!!!
// Read group from DB
- char *pszGroup = getContactCListGroup((HANDLE)wParam);
+ char *pszGroup = getContactCListGroup((HCONTACT)wParam);
- servlistAddContact((HANDLE)wParam, pszGroup);
+ servlistAddContact((HCONTACT)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((HANDLE)wParam, cgs->szModule, cgs->szSetting, cgs->pValue, 0);
+ INT_PTR rc = db_get_s((HCONTACT)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((HANDLE)wParam, &dwUin, &szUid))
+ if (getContactUid((HCONTACT)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((HANDLE)wParam, "Grant");
+ delSetting((HCONTACT)wParam, "Grant");
}
return 0;
@@ -494,7 +494,7 @@ INT_PTR CIcqProto::RevokeAuthorization(WPARAM wParam, LPARAM lParam) DWORD dwUin;
uid_str szUid;
- if (getContactUid((HANDLE)wParam, &dwUin, &szUid))
+ if (getContactUid((HCONTACT)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)
@@ -636,7 +636,7 @@ INT_PTR CIcqProto::SetPassword(WPARAM wParam, LPARAM lParam) HANDLE CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags)
{
int bAdded;
- HANDLE hContact = HContactFromUIN(dwUin, &bAdded);
+ HCONTACT hContact = HContactFromUIN(dwUin, &bAdded);
if (hContact)
{
if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0))
@@ -655,7 +655,7 @@ HANDLE CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) HANDLE CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags)
{
int bAdded;
- HANDLE hContact = HContactFromUID(0, szUID, &bAdded);
+ HCONTACT hContact = HContactFromUID(0, szUID, &bAdded);
if (hContact)
{
if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0))
@@ -673,7 +673,7 @@ HANDLE CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) /////////////////////////////////////////////////////////////////////////////////////////
-void CIcqProto::ICQAddRecvEvent(HANDLE hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags)
+void CIcqProto::ICQAddRecvEvent(HCONTACT 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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 bb764f6efa..b9d112dff3 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;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hConnection;
DWORD dwRemoteIP;
oscar_filetransfer *ft;
@@ -171,7 +171,7 @@ int CIcqProto::IsValidOscarTransfer(void *ft) }
-oscar_filetransfer* CIcqProto::FindOscarTransfer(HANDLE hContact, DWORD dwID1, DWORD dwID2)
+oscar_filetransfer* CIcqProto::FindOscarTransfer(HCONTACT 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)
{
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT 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;
- HANDLE hContact = HContactFromUID(dwUin, szUID, &bAdded);
+ HCONTACT 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(HANDLE hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc)
+HANDLE CIcqProto::oftInitTransfer(HCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc)
{
int i, filesCount;
struct _stati64 statbuf;
@@ -992,7 +992,7 @@ HANDLE CIcqProto::oftInitTransfer(HANDLE hContact, DWORD dwUin, char* szUid, con }
-HANDLE CIcqProto::oftFileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE CIcqProto::oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
DWORD dwUin;
@@ -1025,7 +1025,7 @@ HANDLE CIcqProto::oftFileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *s }
-DWORD CIcqProto::oftFileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szReason)
+DWORD CIcqProto::oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
DWORD dwUin;
@@ -1054,7 +1054,7 @@ DWORD CIcqProto::oftFileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szR }
-DWORD CIcqProto::oftFileCancel(HANDLE hContact, HANDLE hTransfer)
+DWORD CIcqProto::oftFileCancel(HCONTACT hContact, HANDLE hTransfer)
{
oscar_filetransfer* ft = (oscar_filetransfer*)hTransfer;
DWORD dwUin;
@@ -1231,7 +1231,7 @@ void CIcqProto::CloseOscarConnection(oscar_connection *oc) /////////////////////////////////////////////////////////////////////////////////////////
-void CIcqProto::OpenOscarConnection(HANDLE hContact, oscar_filetransfer *ft, int type)
+void CIcqProto::OpenOscarConnection(HCONTACT 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 fa6ec9169e..bf4162b50b 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
{
- HANDLE hContact;
+ HCONTACT hContact;
int flags; // combination of OFTF_*
int containerCount;
char **file_containers;
@@ -123,7 +123,7 @@ void SafeReleaseFileTransfer(void **ft); struct oscar_connection
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hConnection;
int status;
DWORD dwUin;
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index e1e573cc9f..eb36b3277c 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, HANDLE hContact, char *pszText, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hContact, char *pszText, cookie_message_data *pCookieData)
{
icq_packet packet;
WORD wPacketLength;
@@ -355,7 +355,7 @@ DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HANDLE hConta }
-DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HANDLE hContact, WCHAR *pszText, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData)
{
icq_packet packet;
WORD wMessageLen;
@@ -405,7 +405,7 @@ DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HANDLE hCont }
-DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HANDLE hContact, const char *szMessage, int nBodyLen, WORD wPriority, cookie_message_data *pCookieData, char *szCap)
+DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HCONTACT 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, HANDLE hContact, const cha }
-DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HANDLE hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT 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, HANDLE hCont }
-DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, HANDLE hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, HCONTACT 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(HANDLE hContact, DWORD dwUin, int bManual)
+DWORD CIcqProto::icq_sendGetInfoServ(HCONTACT hContact, DWORD dwUin, int bManual)
{
icq_packet packet;
DWORD dwCookie = 0;
@@ -607,7 +607,7 @@ DWORD CIcqProto::icq_sendGetInfoServ(HANDLE hContact, DWORD dwUin, int bManual) }
-DWORD CIcqProto::icq_sendGetAimProfileServ(HANDLE hContact, char* szUid)
+DWORD CIcqProto::icq_sendGetAimProfileServ(HCONTACT hContact, char* szUid)
{
icq_packet packet;
BYTE bUIDlen = strlennull(szUid);
@@ -632,7 +632,7 @@ DWORD CIcqProto::icq_sendGetAimProfileServ(HANDLE hContact, char* szUid) }
-DWORD CIcqProto::icq_sendGetAwayMsgServ(HANDLE hContact, DWORD dwUin, int type, WORD wVersion)
+DWORD CIcqProto::icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD dwUin, int type, WORD wVersion)
{
icq_packet packet;
@@ -650,7 +650,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServ(HANDLE hContact, DWORD dwUin, int type, }
-DWORD CIcqProto::icq_sendGetAwayMsgServExt(HANDLE hContact, DWORD dwUin, char *szUID, int type, WORD wVersion)
+DWORD CIcqProto::icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion)
{
icq_packet packet;
@@ -684,7 +684,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServExt(HANDLE hContact, DWORD dwUin, char *s }
-DWORD CIcqProto::icq_sendGetAimAwayMsgServ(HANDLE hContact, char *szUID, int type)
+DWORD CIcqProto::icq_sendGetAimAwayMsgServ(HCONTACT 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)
{
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT 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)
{
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT 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(HANDLE hContact, DWORD dwUin, char* szUID, int list, int add)
+void CIcqProto::icq_sendChangeVisInvis(HCONTACT 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 a3e8064992..57b3f9ac4f 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(HANDLE hContact, DWORD dwUin, const char *szUid)
+void CIcqProto::AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid)
{
if (!hContact || (!dwUin && !szUid))
return;
@@ -372,7 +372,7 @@ void CIcqProto::InitContactsCache() // build cache
icq_lock l(contactsCacheMutex);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
DWORD dwUin;
@@ -411,7 +411,7 @@ void CIcqProto::UninitContactsCache(void) }
-void CIcqProto::DeleteFromContactsCache(HANDLE hContact)
+void CIcqProto::DeleteFromContactsCache(HCONTACT hContact)
{
icq_lock l(contactsCacheMutex);
@@ -432,7 +432,7 @@ void CIcqProto::DeleteFromContactsCache(HANDLE hContact) }
-HANDLE CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid)
+HCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid)
{
icq_contacts_cache cache_item = { NULL, dwUin, szUid };
@@ -446,12 +446,13 @@ HANDLE CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid) }
-HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
+HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
{
if (Added) *Added = 0;
- HANDLE hContact = HandleFromCacheByUid(dwUin, NULL);
- if (hContact) return hContact;
+ HCONTACT hContact = HandleFromCacheByUid(dwUin, NULL);
+ if (hContact)
+ return hContact;
hContact = FindFirstContact();
while (hContact) {
@@ -468,17 +469,17 @@ HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) //not present: add
if (Added) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!hContact) {
debugLogA("Failed to create ICQ contact %u", dwUin);
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
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 INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
setDword(hContact, UNIQUEIDSETTING, dwUin);
@@ -504,20 +505,21 @@ HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (getContactUin(NULL) == dwUin)
return NULL;
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
-HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
+HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
{
if (dwUin)
return HContactFromUIN(dwUin, Added);
if (Added) *Added = 0;
- if (!m_bAimEnabled) return INVALID_HANDLE_VALUE;
+ if (!m_bAimEnabled)
+ return (HCONTACT)INVALID_HANDLE_VALUE;
- HANDLE hContact = HandleFromCacheByUid(dwUin, szUid);
+ HCONTACT hContact = HandleFromCacheByUid(dwUin, szUid);
if (hContact) return hContact;
hContact = FindFirstContact();
@@ -538,7 +540,7 @@ HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) //not present: add
if (Added) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
setString(hContact, UNIQUEIDSETTING, szUid);
@@ -558,11 +560,11 @@ HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) return hContact;
}
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
-HANDLE CIcqProto::HContactFromAuthEvent(HANDLE hEvent)
+HCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
DWORD body[3];
@@ -571,28 +573,28 @@ HANDLE CIcqProto::HContactFromAuthEvent(HANDLE hEvent) dbei.pBlob = (PBYTE)&body;
if (db_event_get(hEvent, &dbei))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (strcmpnull(dbei.szModule, m_szModuleName))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
return DbGetAuthEventContact(&dbei);
}
-char *NickFromHandle(HANDLE hContact)
+char *NickFromHandle(HCONTACT hContact)
{
- if (hContact == INVALID_HANDLE_VALUE)
+ if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
return null_strdup(Translate("<invalid>"));
return null_strdup((char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0));
}
-char *NickFromHandleUtf(HANDLE hContact)
+char *NickFromHandleUtf(HCONTACT hContact)
{
- if (hContact == INVALID_HANDLE_VALUE)
+ if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
return ICQTranslateUtf(LPGEN("<invalid>"));
return tchar_to_utf8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR));
@@ -886,7 +888,7 @@ void CIcqProto::ResetSettingsOnListReload() setWord("SrvRecordCount", 0);
delSetting(DBSETTING_SERVLIST_UNHANDLED);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
// All these values will be restored during the serv-list receive
@@ -910,7 +912,7 @@ void CIcqProto::ResetSettingsOnConnect() setByte("SrvVisibility", 0);
setDword("IdleTS", 0);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
setDword(hContact, "LogonTS", 0);
@@ -931,7 +933,7 @@ void CIcqProto::ResetSettingsOnLoad() setDword("IdleTS", 0);
setDword("LogonTS", 0);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
setDword(hContact, "LogonTS", 0);
@@ -987,7 +989,7 @@ void __cdecl CIcqProto::ProtocolAckThread(icq_ack_args* pArguments) SAFE_FREE((void**)&pArguments);
}
-void CIcqProto::SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage)
+void CIcqProto::SendProtoAck(HCONTACT 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;
@@ -1008,7 +1010,7 @@ void CIcqProto::SetCurrentStatus(int nStatus) }
-int CIcqProto::IsMetaInfoChanged(HANDLE hContact)
+int CIcqProto::IsMetaInfoChanged(HCONTACT hContact)
{
DBVARIANT infoToken = { DBVT_DELETED };
int res = 0;
@@ -1248,7 +1250,7 @@ int CIcqProto::SetStatusMood(const char *szMoodData, DWORD dwDelay) }
-void CIcqProto::writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
oscar_tlv *pTLV = chain->getTLV(wTlv, 1);
@@ -1263,7 +1265,7 @@ void CIcqProto::writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSe }
-void CIcqProto::writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
int num = chain->getNumber(wTlv, 1);
if (num > 0)
@@ -1273,7 +1275,7 @@ void CIcqProto::writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting }
-void CIcqProto::writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
int num = chain->getNumber(wTlv, 1);
@@ -1284,7 +1286,7 @@ void CIcqProto::writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting }
-void CIcqProto::writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
double num = chain->getDouble(wTlv, 1);
if (num > 0)
@@ -1293,7 +1295,7 @@ void CIcqProto::writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetti delSetting(hContact, szSetting);
}
-void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVDate(HCONTACT hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv)
{
double time = chain->getDouble(wTlv, 1);
@@ -1318,7 +1320,7 @@ void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSetting }
-void CIcqProto::writeDbInfoSettingTLVBlob(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
oscar_tlv *pTLV = chain->getTLV(wTlv, 1);
@@ -1329,7 +1331,7 @@ void CIcqProto::writeDbInfoSettingTLVBlob(HANDLE hContact, const char *szSetting }
-BOOL CIcqProto::writeDbInfoSettingString(HANDLE hContact, const char* szSetting, char** buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingString(HCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength)
{
if (*pwLength < 2)
return FALSE;
@@ -1362,7 +1364,7 @@ BOOL CIcqProto::writeDbInfoSettingString(HANDLE hContact, const char* szSetting, return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength)
{
if (*pwLength < 2)
return FALSE;
@@ -1379,7 +1381,7 @@ BOOL CIcqProto::writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, c return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
{
if (*pwLength < 2)
return FALSE;
@@ -1398,7 +1400,7 @@ BOOL CIcqProto::writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szS return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength)
{
if (*pwLength < 1)
return FALSE;
@@ -1415,7 +1417,7 @@ BOOL CIcqProto::writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting, return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingByteWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingByteWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
{
if (*pwLength < 1)
return FALSE;
@@ -1448,7 +1450,7 @@ char* time2text(time_t time) }
-bool CIcqProto::validateStatusMessageRequest(HANDLE hContact, WORD byMessageType)
+bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType)
{
// Privacy control
if (getByte("StatusMsgReplyCList", 0)) {
@@ -1902,7 +1904,7 @@ int MessageBoxUtf(HWND hWnd, const char *szText, const char *szCaption, UINT uTy return res;
}
-char* CIcqProto::ConvertMsgToUserSpecificAnsi(HANDLE hContact, const char* szMsg)
+char* CIcqProto::ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg)
{ // this takes utf-8 encoded message
WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage);
char* szAnsi = NULL;
@@ -1915,7 +1917,7 @@ char* CIcqProto::ConvertMsgToUserSpecificAnsi(HANDLE hContact, const char* szMsg }
// just broadcast generic send error with dummy cookie and return that cookie
-DWORD CIcqProto::ReportGenericSendError(HANDLE hContact, int nType, const char* szErrorMsg)
+DWORD CIcqProto::ReportGenericSendError(HCONTACT 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 25387d7ef3..c229feac2a 100644 --- a/protocols/IcqOscarJ/src/utilities.h +++ b/protocols/IcqOscarJ/src/utilities.h @@ -33,7 +33,7 @@ struct icq_ack_args
{
- HANDLE hContact;
+ HCONTACT hContact;
int nAckType;
int nAckResult;
HANDLE hSequence;
@@ -42,7 +42,7 @@ struct icq_ack_args struct icq_contacts_cache
{
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact);
-char *NickFromHandleUtf(HANDLE hContact);
+char *NickFromHandle(HCONTACT hContact);
+char *NickFromHandleUtf(HCONTACT 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(HANDLE hContact, int xstatus);
+void setContactExtraIcon(HCONTACT hContact, int xstatus);
int OnReloadIcons(WPARAM wParam, LPARAM lParam);
#endif /* __UTILITIES_H */
|