summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/Gadu-Gadu/src
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (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/Gadu-Gadu/src')
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp8
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp32
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp52
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/gg.h4
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp38
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h64
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp30
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/links.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/services.cpp2
13 files changed, 130 insertions, 132 deletions
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index e97d3a319f..6cadef414a 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -26,7 +26,7 @@
//////////////////////////////////////////////////////////
// Avatars support
-void GGPROTO::getAvatarFilename(HANDLE hContact, TCHAR *pszDest, int cbLen)
+void GGPROTO::getAvatarFilename(HCONTACT hContact, TCHAR *pszDest, int cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName);
@@ -142,7 +142,7 @@ char *gg_avatarhash(char *param)
return bin2hex(digest, sizeof(digest), result);
}
-void GGPROTO::requestAvatarTransfer(HANDLE hContact, char *szAvatarURL)
+void GGPROTO::requestAvatarTransfer(HCONTACT hContact, char *szAvatarURL)
{
if (pth_avatar.dwThreadId == NULL) {
debugLogA("requestAvatarTransfer(): Can not list_add element to avatar_transfers list. No pth_avatar.dwThreadId");
@@ -159,7 +159,7 @@ void GGPROTO::requestAvatarTransfer(HANDLE hContact, char *szAvatarURL)
gg_LeaveCriticalSection(&avatar_mutex, "requestAvatarTransfer", 1, 1, "avatar_mutex", 1);
}
-void GGPROTO::requestAvatarInfo(HANDLE hContact, int iWaitFor)
+void GGPROTO::requestAvatarInfo(HCONTACT hContact, int iWaitFor)
{
if (pth_avatar.dwThreadId == NULL) {
debugLogA("requestAvatarInfo(): Can not list_add element to avatar_requests list. No pth_avatar.dwThreadId");
@@ -192,7 +192,7 @@ void __cdecl GGPROTO::avatarrequestthread(void*)
if (avatar_requests.getCount()) {
GGREQUESTAVATARDATA *data = avatar_requests[0];
int iWaitFor = data->iWaitFor;
- HANDLE hContact = data->hContact;
+ HCONTACT hContact = data->hContact;
avatar_requests.remove(0);
mir_free(data);
gg_LeaveCriticalSection(&avatar_mutex, "avatarrequestthread", 3, 1, "avatar_mutex", 1);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 938e1dead2..562468c5e9 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -628,7 +628,7 @@ retry:
const char *__status = gg_pubdir50_get(res, i, GG_PUBDIR50_STATUS);
uin_t uin = __fmnumber ? atoi(__fmnumber) : 0;
- HANDLE hContact = (res->seq == GG_SEQ_CHINFO) ? NULL : getcontact(uin, 0, 0, NULL);
+ HCONTACT hContact = (res->seq == GG_SEQ_CHINFO) ? NULL : getcontact(uin, 0, 0, NULL);
debugLogA("mainthread() (%x): Search result for uin %d, seq %d.", this, uin, res->seq);
if (res->seq == GG_SEQ_SEARCH)
{
@@ -766,7 +766,7 @@ retry:
// Status (version >= 6.0)
case GG_EVENT_STATUS60:
{
- HANDLE hContact = getcontact(e->event.status60.uin, 0, 0, NULL);
+ HCONTACT hContact = getcontact(e->event.status60.uin, 0, 0, NULL);
int oldstatus = getWord(hContact, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE);
uin_t uin = (uin_t)getDword(GG_KEY_UIN, 0);
@@ -991,7 +991,7 @@ retry:
// Get rid of empty image
if (e->event.image_reply.size && e->event.image_reply.image)
{
- HANDLE hContact = getcontact(e->event.image_reply.sender, 1, 0, NULL);
+ HCONTACT hContact = getcontact(e->event.image_reply.sender, 1, 0, NULL);
void *img = (void *)img_loadpicture(e, 0);
if (!img)
@@ -1064,7 +1064,7 @@ retry:
pre.tszDescription = filenameT;
pre.ptszFiles = &filenameT;
pre.lParam = (LPARAM)dcc7;
- ProtoChainRecvFile(dcc7->contact, &pre);
+ ProtoChainRecvFile((HCONTACT)dcc7->contact, &pre);
mir_free(filenameT);
e->event.dcc7_new = NULL;
@@ -1078,7 +1078,7 @@ retry:
if (dcc7->type == GG_SESSION_DCC7_SEND)
{
debugLogA("mainthread() (%x): File transfer denied by client %d (reason = %d).", this, dcc7->peer_uin, e->event.dcc7_reject.reason);
- ProtoBroadcastAck(dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
// Remove from watches and free
gg_EnterCriticalSection(&ft_mutex, "mainthread", 21, "ft_mutex", 1);
@@ -1139,7 +1139,7 @@ retry:
}
if (dcc7->contact)
- ProtoBroadcastAck(dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Free dcc
gg_dcc7_free(dcc7);
@@ -1186,7 +1186,7 @@ retry:
case GG_EVENT_TYPING_NOTIFICATION:
{
- HANDLE hContact = getcontact(e->event.typing_notification.uin, 0, 0, NULL);
+ HCONTACT hContact = getcontact(e->event.typing_notification.uin, 0, 0, NULL);
#ifdef DEBUGMODE
debugLogA("mainthread() (%x): Typing notification from %d (%d).", this,
e->event.typing_notification.uin, e->event.typing_notification.length);
@@ -1272,7 +1272,7 @@ void GGPROTO::broadcastnewstatus(int newStatus)
// When contact is deleted
int GGPROTO::contactdeleted(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
uin_t uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0);
// Terminate conference if contact is deleted
@@ -1327,7 +1327,7 @@ static TCHAR* sttSettingToTchar( DBVARIANT* value )
int GGPROTO::dbsettingchanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char *szProto = NULL;
debugLogA("dbsettingchanged(): fired. szModule=%s szSetting=%s", cws->szModule, cws->szSetting);
@@ -1411,7 +1411,7 @@ void GGPROTO::setalloffline()
debugLogA("setalloffline(): started. Setting buddies offline");
setWord(GG_KEY_STATUS, ID_STATUS_OFFLINE);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
setWord(hContact, GG_KEY_STATUS, ID_STATUS_OFFLINE);
// Clear IP and port settings
delSetting(hContact, GG_KEY_CLIENTIP);
@@ -1427,7 +1427,7 @@ void GGPROTO::setalloffline()
////////////////////////////////////////////////////////////
// All users set offline
-void GGPROTO::notifyuser(HANDLE hContact, int refresh)
+void GGPROTO::notifyuser(HCONTACT hContact, int refresh)
{
uin_t uin;
if (!hContact) return;
@@ -1469,7 +1469,7 @@ void GGPROTO::notifyuser(HANDLE hContact, int refresh)
void GGPROTO::notifyall()
{
- HANDLE hContact;
+ HCONTACT hContact;
int count = 0, cc = 0;
uin_t *uins;
char *types;
@@ -1522,13 +1522,13 @@ void GGPROTO::notifyall()
////////////////////////////////////////////////////////////
// Get contact by uin
-HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
+HCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
{
#ifdef DEBUGMODE
debugLogA("getcontact(): uin=%d create=%d inlist=%d", uin, create, inlist);
#endif
// Look for contact in DB
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if ((uin_t)getDword(hContact, GG_KEY_UIN, 0) == uin && !isChatRoom(hContact)) {
if (inlist) {
db_unset(hContact, "CList", "NotOnList");
@@ -1540,7 +1540,7 @@ HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
if (!create)
return NULL;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!hContact) {
debugLog(_T("getcontact(): Failed to create Gadu-Gadu contact %s"), szNick);
return NULL;
@@ -1698,7 +1698,7 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const TCHAR *idescr, in
#ifdef DEBUGMODE
debugLogA("changecontactstatus(): uin=%d status=%d", uin, status);
#endif
- HANDLE hContact = getcontact(uin, 0, 0, NULL);
+ HCONTACT hContact = getcontact(uin, 0, 0, NULL);
// Check if contact is on list
if (!hContact) return;
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index 2e9093015c..e0f39d35dc 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -38,7 +38,7 @@ extern INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam
#define SVS_TIMEZONE 7
#define SVS_GGVERSION 9
-static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, char *szSetting, int special, int disableIfUndef)
+static void SetValue(HWND hwndDlg, int idCtrl, HCONTACT hContact, char *szModule, char *szSetting, int special, int disableIfUndef)
{
DBVARIANT dbv = {0};
TCHAR str[256];
@@ -688,7 +688,7 @@ static INT_PTR CALLBACK gg_advoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
struct GGDETAILSDLGDATA
{
GGPROTO *gg;
- HANDLE hContact;
+ HCONTACT hContact;
int disableUpdate;
int updating;
};
@@ -704,7 +704,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
TranslateDialogDefault(hwndDlg);
dat = (struct GGDETAILSDLGDATA *)mir_alloc(sizeof(struct GGDETAILSDLGDATA));
- dat->hContact=(HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
dat->disableUpdate = FALSE;
dat->updating = FALSE;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
@@ -728,7 +728,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
case PSN_INFOCHANGED:
{
char *szProto;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
GGPROTO *gg = dat->gg;
// Show updated message
@@ -902,7 +902,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
int GGPROTO::details_init(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
char* pszTemplate;
if (hContact == NULL){
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index 761b5a7747..38a38bf22c 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -60,7 +60,7 @@ void GGPROTO::dccstart()
void GGPROTO::dccconnect(uin_t uin)
{
struct gg_dcc *local_dcc;
- HANDLE hContact = getcontact(uin, 0, 0, NULL);
+ HCONTACT hContact = getcontact(uin, 0, 0, NULL);
DWORD ip, myuin; WORD port;
debugLogA("dccconnect(): Connecting to uin %d.", uin);
@@ -89,7 +89,7 @@ void GGPROTO::dccconnect(uin_t uin)
// THREAD: File transfer fail
struct ftfaildata
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hProcess;
};
@@ -103,7 +103,7 @@ void __cdecl GGPROTO::ftfailthread(void *param)
debugLogA("ftfailthread(): end.");
}
-HANDLE ftfail(GGPROTO *gg, HANDLE hContact)
+HANDLE ftfail(GGPROTO *gg, HCONTACT hContact)
{
ftfaildata *ft = (ftfaildata*)malloc(sizeof(struct ftfaildata));
#ifdef DEBUGMODE
@@ -273,7 +273,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (HANDLE)local_dcc->contact;
+ pfts.hContact = (HCONTACT)local_dcc->contact;
pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -286,7 +286,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc->offset;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 3, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
break;
@@ -304,7 +304,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (HANDLE)local_dcc->contact;
+ pfts.hContact = (HCONTACT)local_dcc->contact;
pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -317,11 +317,11 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc->file_info.size;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 4, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
_close(local_dcc->file_fd); local_dcc->file_fd = -1;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 5, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc, 0);
+ ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
// Free dcc
@@ -361,7 +361,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
{
_close(local_dcc->file_fd); local_dcc->file_fd = -1;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 6, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc, 0);
+ ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
// Free dcc
@@ -393,7 +393,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
pre.lParam = (LPARAM)local_dcc;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 7, "ft_mutex", 1);
- ProtoChainRecvFile(local_dcc->contact, &pre);
+ ProtoChainRecvFile((HCONTACT)local_dcc->contact, &pre);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
mir_free(filenameT);
@@ -503,7 +503,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (HANDLE)local_dcc7->contact;
+ pfts.hContact = (HCONTACT)local_dcc7->contact;
pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -516,7 +516,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc7->offset;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 9, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
break;
@@ -534,7 +534,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (HANDLE)local_dcc7->contact;
+ pfts.hContact = (HCONTACT)local_dcc7->contact;
pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -547,11 +547,11 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc7->size;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 10, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
_close(local_dcc7->file_fd); local_dcc7->file_fd = -1;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 11, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc7, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
// Free dcc
@@ -595,7 +595,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
if (local_dcc7->contact) {
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 12, "ft_mutex", 1);
- ProtoBroadcastAck(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc7, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
@@ -684,7 +684,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath)
TCHAR error[512];
mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
- ProtoBroadcastAck(dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
+ ProtoBroadcastAck((HCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
// Free transfer
gg_free_dcc(dcc);
return 0;
@@ -722,7 +722,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath)
if (iFtRemoveRes == -1)
{
debugLogA("dcc7fileallow(): File transfer denied.");
- ProtoBroadcastAck(dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
// Free transfer
gg_dcc7_free(dcc7);
return 0;
@@ -736,7 +736,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath)
mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
- ProtoBroadcastAck(dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Free transfer
gg_dcc7_free(dcc7);
return 0;
@@ -807,7 +807,7 @@ int GGPROTO::dccfilecancel(HANDLE hTransfer)
gg_LeaveCriticalSection(&ft_mutex, "dccfilecancel", 44, 1, "ft_mutex", 1);
// Send failed info
- ProtoBroadcastAck(dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
+ ProtoBroadcastAck((HCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
// Close file
if (dcc->file_fd != -1)
{
@@ -837,7 +837,7 @@ int GGPROTO::dcc7filecancel(HANDLE hTransfer)
gg_LeaveCriticalSection(&ft_mutex, "dcc7filecancel", 45, 1, "ft_mutex", 1);
// Send failed info
- ProtoBroadcastAck(dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Close file
if (dcc7->file_fd != -1)
{
@@ -856,7 +856,7 @@ int GGPROTO::dcc7filecancel(HANDLE hTransfer)
////////////////////////////////////////////////////////////
// File receiving allowed
-HANDLE GGPROTO::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+HANDLE GGPROTO::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
{
// Check if its proper dcc
struct gg_common *c = (struct gg_common *) hTransfer;
@@ -872,7 +872,7 @@ HANDLE GGPROTO::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* sz
////////////////////////////////////////////////////////////
// File transfer canceled
-int GGPROTO::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int GGPROTO::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
// Check if its proper dcc
struct gg_common *c = (struct gg_common *) hTransfer;
@@ -888,7 +888,7 @@ int GGPROTO::FileCancel(HANDLE hContact, HANDLE hTransfer)
////////////////////////////////////////////////////////////
// File receiving denied
-int GGPROTO::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
+int GGPROTO::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
{
// Check if its proper dcc
struct gg_common *c = (struct gg_common *) hTransfer;
@@ -904,7 +904,7 @@ int GGPROTO::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReas
////////////////////////////////////////////////////////////
// Called when received an file
-int GGPROTO::RecvFile(HANDLE hContact, PROTOFILEEVENT* pre)
+int GGPROTO::RecvFile(HCONTACT hContact, PROTOFILEEVENT* pre)
{
return Proto_RecvFile(hContact, pre);
}
@@ -912,7 +912,7 @@ int GGPROTO::RecvFile(HANDLE hContact, PROTOFILEEVENT* pre)
////////////////////////////////////////////////////////////
// Called when user sends a file
-HANDLE GGPROTO::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+HANDLE GGPROTO::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
{
char *bslash, *filename;
struct gg_dcc *dcc;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 674ebe146d..2945c3c96c 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -196,7 +196,7 @@ static int gg_modulesloaded(WPARAM wParam, LPARAM lParam)
//////////////////////////////////////////////////////////
// Gets protocol instance associated with a contact
-static GGPROTO* gg_getprotoinstance(HANDLE hContact)
+static GGPROTO* gg_getprotoinstance(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -213,7 +213,7 @@ static GGPROTO* gg_getprotoinstance(HANDLE hContact)
// Handles PrebuildContactMenu event
static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)wParam;
GGPROTO* gg = gg_getprotoinstance(hContact);
if (gg == NULL)
return 0;
@@ -232,7 +232,7 @@ static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam)
// Contact block service function
INT_PTR GGPROTO::blockuser(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)wParam;
setByte(hContact, GG_KEY_BLOCK, !getByte(hContact, GG_KEY_BLOCK, 0));
notifyuser(hContact, 1);
return 0;
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h
index 2acf921ec1..d5babd7e52 100644
--- a/protocols/Gadu-Gadu/src/gg.h
+++ b/protocols/Gadu-Gadu/src/gg.h
@@ -122,13 +122,13 @@ typedef struct
struct GGREQUESTAVATARDATA
{
- HANDLE hContact;
+ HCONTACT hContact;
int iWaitFor;
};
struct GGGETAVATARDATA
{
- HANDLE hContact;
+ HCONTACT hContact;
char *szAvatarURL;
};
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 69b3afc0f9..24e8c40aa8 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -127,16 +127,16 @@ GGPROTO::~GGPROTO()
HANDLE GGPROTO::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; }
int GGPROTO::Authorize(HANDLE hDbEvent) { return 1; }
int GGPROTO::AuthDeny(HANDLE hDbEvent, const TCHAR *szReason) { return 1; }
-int GGPROTO::AuthRecv(HANDLE hContact, PROTORECVEVENT *pre) { return 1; }
-int GGPROTO::AuthRequest(HANDLE hContact, const TCHAR *szMessage) { return 1; }
+int GGPROTO::AuthRecv(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
+int GGPROTO::AuthRequest(HCONTACT hContact, const TCHAR *szMessage) { return 1; }
HANDLE GGPROTO::ChangeInfo(int iInfoType, void *pInfoData) { return NULL; }
int GGPROTO::FileResume(HANDLE hTransfer, int *action, const PROTOCHAR** szFilename) { return 1; }
HANDLE GGPROTO::SearchByEmail(const PROTOCHAR *email) { return NULL; }
-int GGPROTO::RecvContacts(HANDLE hContact, PROTORECVEVENT *pre) { return 1; }
-int GGPROTO::RecvUrl(HANDLE hContact, PROTORECVEVENT *pre) { return 1; }
-int GGPROTO::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE *hContactsList) { return 1; }
-int GGPROTO::SendUrl(HANDLE hContact, int flags, const char *url) { return 1; }
-int GGPROTO::RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT *evt) { return 1; }
+int GGPROTO::RecvContacts(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
+int GGPROTO::RecvUrl(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
+int GGPROTO::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) { return 1; }
+int GGPROTO::SendUrl(HCONTACT hContact, int flags, const char *url) { return 1; }
+int GGPROTO::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 1; }
//////////////////////////////////////////////////////////
// when contact is added to list
@@ -160,7 +160,7 @@ HANDLE GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *psr)
//////////////////////////////////////////////////////////
// checks proto capabilities
-DWORD_PTR GGPROTO::GetCaps(int type, HANDLE hContact)
+DWORD_PTR GGPROTO::GetCaps(int type, HCONTACT hContact)
{
switch (type) {
case PFLAGNUM_1:
@@ -190,11 +190,11 @@ void __cdecl GGPROTO::cmdgetinfothread(void *hContact)
{
debugLogA("cmdgetinfothread(): started. Failed info retreival.");
gg_sleep(100, FALSE, "cmdgetinfothread", 103, 1);
- ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE) 1, 0);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
debugLogA("cmdgetinfothread(): end.");
}
-int GGPROTO::GetInfo(HANDLE hContact, int infoType)
+int GGPROTO::GetInfo(HCONTACT hContact, int infoType)
{
gg_pubdir50_t req;
@@ -570,7 +570,7 @@ HWND GGPROTO::CreateExtendedSearchUI(HWND owner)
//////////////////////////////////////////////////////////
// when messsage received
-int GGPROTO::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int GGPROTO::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{
return Proto_RecvMessage(hContact, pre);
}
@@ -580,7 +580,7 @@ int GGPROTO::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
int seq;
} GG_SEQ_ACK;
@@ -592,7 +592,7 @@ void __cdecl GGPROTO::sendackthread(void *ack)
mir_free(ack);
}
-int GGPROTO::SendMsg(HANDLE hContact, int flags, const char *msg)
+int GGPROTO::SendMsg(HCONTACT hContact, int flags, const char *msg)
{
uin_t uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0);
if (!isonline() || !uin)
@@ -633,7 +633,7 @@ int GGPROTO::SendMsg(HANDLE hContact, int flags, const char *msg)
//////////////////////////////////////////////////////////
// visible lists
-int GGPROTO::SetApparentMode(HANDLE hContact, int mode)
+int GGPROTO::SetApparentMode(HCONTACT hContact, int mode)
{
setWord(hContact, GG_KEY_APPARENT, (WORD)mode);
notifyuser(hContact, 1);
@@ -670,18 +670,18 @@ void __cdecl GGPROTO::getawaymsgthread(void *hContact)
debugLogA("getawaymsgthread(): started");
gg_sleep(100, FALSE, "getawaymsgthread", 106, 1);
- if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR))
+ if (!db_get_s((HCONTACT)hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR))
{
- ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) dbv.ptszVal);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
debugLog(_T("getawaymsgthread(): Reading away msg <%s>."), dbv.ptszVal);
db_free(&dbv);
} else {
- ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) NULL);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL);
}
debugLogA("getawaymsgthread(): end");
}
-HANDLE GGPROTO::GetAwayMsg(HANDLE hContact)
+HANDLE GGPROTO::GetAwayMsg(HCONTACT hContact)
{
#ifdef DEBUGMODE
debugLogA("GetAwayMsg(): ForkThread 17 GGPROTO::getawaymsgthread");
@@ -757,7 +757,7 @@ int GGPROTO::SetAwayMsg(int iStatus, const PROTOCHAR *newMsg)
//////////////////////////////////////////////////////////
// sends a notification that the user is typing a message
-int GGPROTO::UserIsTyping(HANDLE hContact, int type)
+int GGPROTO::UserIsTyping(HCONTACT hContact, int type)
{
uin_t uin = getDword(hContact, GG_KEY_UIN, 0);
if (!uin || !isonline())
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index acc9c1b395..4aa8a54ca4 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -36,18 +36,18 @@ struct GGPROTO : public PROTO<GGPROTO>
virtual int __cdecl Authorize( HANDLE hDbEvent );
virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ 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 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 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 TCHAR* id );
virtual HANDLE __cdecl SearchByEmail( const TCHAR* email );
@@ -55,24 +55,24 @@ struct GGPROTO : public PROTO<GGPROTO>
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 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 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 );
@@ -110,10 +110,10 @@ struct GGPROTO : public PROTO<GGPROTO>
void gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging);
/* Global GG functions */
- void notifyuser(HANDLE hContact, int refresh);
+ void notifyuser(HCONTACT hContact, int refresh);
void setalloffline();
void disconnect();
- HANDLE getcontact(uin_t uin, int create, int inlist, TCHAR *nick);
+ HCONTACT getcontact(uin_t uin, int create, int inlist, TCHAR *nick);
void __cdecl mainthread(void *empty);
int isonline();
int refreshstatus(int status);
@@ -133,9 +133,9 @@ struct GGPROTO : public PROTO<GGPROTO>
void menus_init();
/* Avatar functions */
- void getAvatarFilename(HANDLE hContact, TCHAR *pszDest, int cbLen);
- void requestAvatarTransfer(HANDLE hContact, char *szAvatarURL);
- void requestAvatarInfo(HANDLE hContact, int iWaitFor);
+ void getAvatarFilename(HCONTACT hContact, TCHAR *pszDest, int cbLen);
+ void requestAvatarTransfer(HCONTACT hContact, char *szAvatarURL);
+ void requestAvatarInfo(HCONTACT hContact, int iWaitFor);
void getOwnAvatar();
void setAvatar(const TCHAR *szFilename);
bool getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts);
@@ -152,11 +152,11 @@ struct GGPROTO : public PROTO<GGPROTO>
void __cdecl setavatarthread(void*);
/* File transfer functions */
- HANDLE fileallow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
- int filecancel(HANDLE hContact, HANDLE hTransfer);
- int filedeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
- int recvfile(HANDLE hContact, PROTOFILEEVENT* pre);
- HANDLE sendfile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
+ HANDLE fileallow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
+ int filecancel(HCONTACT hContact, HANDLE hTransfer);
+ int filedeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
+ int recvfile(HCONTACT hContact, PROTOFILEEVENT* pre);
+ HANDLE sendfile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
HANDLE dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath);
HANDLE dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath);
@@ -187,8 +187,8 @@ struct GGPROTO : public PROTO<GGPROTO>
int img_sendonrequest(gg_event* e);
BOOL img_opened(uin_t uin);
void *img_loadpicture(gg_event* e, TCHAR *szFileName);
- int img_display(HANDLE hContact, void *img);
- int img_displayasmsg(HANDLE hContact, void *img);
+ int img_display(HCONTACT hContact, void *img);
+ int img_displayasmsg(HCONTACT hContact, void *img);
void __cdecl img_dlgcallthread(void *param);
@@ -211,7 +211,7 @@ struct GGPROTO : public PROTO<GGPROTO>
int gc_destroy();
TCHAR * gc_getchat(uin_t sender, uin_t *recipients, int recipients_count);
GGGC *gc_lookup(const TCHAR *id);
- int gc_changenick(HANDLE hContact, TCHAR *ptszNick);
+ int gc_changenick(HCONTACT hContact, TCHAR *ptszNick);
int __cdecl gc_event(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 5fb2027896..676b7abbe5 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -138,8 +138,8 @@ int GGPROTO::gc_event(WPARAM wParam, LPARAM lParam)
list_remove(&chats, chat, 1);
// Remove contact from contact list (duh!) should be done by chat.dll !!
- for (HANDLE hContact = db_find_first(); hContact; ) {
- HANDLE hNext = db_find_next(hContact);
+ for (HCONTACT hContact = db_find_first(); hContact; ) {
+ HCONTACT hNext = db_find_next(hContact);
DBVARIANT dbv;
if (!getTString(hContact, "ChatRoomID", &dbv)) {
if (dbv.ptszVal && !_tcscmp(gch->pDest->ptszID, dbv.ptszVal))
@@ -193,7 +193,7 @@ int GGPROTO::gc_event(WPARAM wParam, LPARAM lParam)
// Privmessage selected
if (gch->pDest->iType == GC_USER_PRIVMESS)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
if ((uin = _ttoi(gch->ptszUID)) && (hContact = getcontact(uin, 1, 0, NULL)))
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
}
@@ -369,7 +369,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
// Add contacts
for(i = 0; i < chat->recipients_count; i++) {
- HANDLE hContact = getcontact(chat->recipients[i], 1, 0, NULL);
+ HCONTACT hContact = getcontact(chat->recipients[i], 1, 0, NULL);
UIN2IDT(chat->recipients[i], id);
if (hContact && (name = pcli->pfnGetContactDisplayName(hContact, 0)) != NULL)
gce.ptszNick = name;
@@ -389,7 +389,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
return chat->id;
}
-static HANDLE gg_getsubcontact(GGPROTO* gg, HANDLE hContact)
+static HCONTACT gg_getsubcontact(GGPROTO* gg, HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
char* szMetaProto = (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
@@ -397,10 +397,8 @@ static HANDLE gg_getsubcontact(GGPROTO* gg, HANDLE hContact)
if (szProto && szMetaProto && (INT_PTR)szMetaProto != CALLSERVICE_NOTFOUND && !lstrcmpA(szProto, szMetaProto))
{
int nSubContacts = (int)CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0), i;
- HANDLE hMetaContact;
- for (i = 0; i < nSubContacts; i++)
- {
- hMetaContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
+ for (i = 0; i < nSubContacts; i++) {
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
szProto = GetContactProto(hMetaContact);
if (szProto && !lstrcmpA(szProto, gg->m_szModuleName))
return hMetaContact;
@@ -425,7 +423,7 @@ static void gg_gc_resetclistopts(HWND hwndList)
static int gg_gc_countcheckmarks(HWND hwndList)
{
int count = 0;
- 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(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
count++;
@@ -477,10 +475,10 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
TCHAR* chat;
uin_t* participants = (uin_t*)calloc(count, sizeof(uin_t));
gg->debugLogA("gg_gc_openconfdlg(): WM_COMMAND IDOK Opening new conference for %d contacts.", count);
- for (HANDLE hContact = db_find_first(); hContact && i < count; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact && i < count; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
- HANDLE hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
+ HCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
participants[i++] = db_get_dw(hMetaContact ? hMetaContact : hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
}
}
@@ -526,10 +524,10 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
if (!gg) break;
// Delete non-gg contacts
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ HCONTACT hItem = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
- HANDLE hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
+ HCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
if (hMetaContact) {
szProto = gg->m_szModuleName;
uin = (uin_t)gg->getDword(hMetaContact, GG_KEY_UIN, 0);
@@ -620,7 +618,7 @@ INT_PTR GGPROTO::gc_openconf(WPARAM wParam, LPARAM lParam)
return 1;
}
-int GGPROTO::gc_changenick(HANDLE hContact, TCHAR *ptszNick)
+int GGPROTO::gc_changenick(HCONTACT hContact, TCHAR *ptszNick)
{
list_t l;
uin_t uin = getDword(hContact, GG_KEY_UIN, 0);
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 15006095aa..607edfdb37 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -49,7 +49,7 @@ typedef struct _GGIMAGEENTRY
typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hEvent;
HWND hWnd;
uin_t uin;
@@ -730,7 +730,7 @@ void __cdecl GGPROTO::img_dlgcallthread(void *param)
////////////////////////////////////////////////////////////////////////////
// Open dialog receive for specified contact
-GGIMAGEDLGDATA *gg_img_recvdlg(GGPROTO *gg, HANDLE hContact)
+GGIMAGEDLGDATA *gg_img_recvdlg(GGPROTO *gg, HCONTACT hContact)
{
// Create dialog data
GGIMAGEDLGDATA *dat = (GGIMAGEDLGDATA *)calloc(1, sizeof(GGIMAGEDLGDATA));
@@ -804,7 +804,7 @@ TCHAR *gg_img_hasextension(TCHAR *filename)
////////////////////////////////////////////////////////////////////////////////
// Display received image using message with [img] BBCode
-int GGPROTO::img_displayasmsg(HANDLE hContact, void *img)
+int GGPROTO::img_displayasmsg(HCONTACT hContact, void *img)
{
GGIMAGEENTRY *dat = (GGIMAGEENTRY *)img;
TCHAR szPath[MAX_PATH], path[MAX_PATH], *pImgext, imgext[6];
@@ -896,7 +896,7 @@ BOOL GGPROTO::img_opened(uin_t uin)
////////////////////////////////////////////////////////////////////////////
// Image Module : Looking for window entry, create if not found
-int GGPROTO::img_display(HANDLE hContact, void *img)
+int GGPROTO::img_display(HCONTACT hContact, void *img)
{
list_t l = imagedlgs;
GGIMAGEDLGDATA *dat;
@@ -1173,7 +1173,7 @@ BOOL GGPROTO::img_sendonrequest(gg_event* e)
INT_PTR GGPROTO::img_sendimg(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
GGIMAGEDLGDATA *dat = NULL;
gg_EnterCriticalSection(&img_mutex, "img_sendimg", 64, "img_mutex", 1);
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index 1ac699ffcd..e4954fc14c 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -26,7 +26,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr)
char *contacts;
// Readup contacts
- for (HANDLE hContact = db_find_first(gg->m_szModuleName); hContact; hContact = db_find_next(hContact, gg->m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(gg->m_szModuleName); hContact; hContact = db_find_next(hContact, gg->m_szModuleName)) {
if (gg->isChatRoom(hContact))
continue;
@@ -210,7 +210,7 @@ void GGPROTO::parsecontacts(char *contacts)
// Loadup contact
if (uin && strNick)
{
- HANDLE hContact = getcontact(uin, 1, 1, _A2T(strNick));
+ HCONTACT hContact = getcontact(uin, 1, 1, _A2T(strNick));
#ifdef DEBUGMODE
debugLogA("parsecontacts(): Found contact %d with nickname \"%s\".", uin, strNick);
#endif
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp
index 2e6238a963..f241938c5a 100644
--- a/protocols/Gadu-Gadu/src/links.cpp
+++ b/protocols/Gadu-Gadu/src/links.cpp
@@ -99,7 +99,7 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam)
if (ServiceExists(MS_MSG_SENDMESSAGE))
{
- HANDLE hContact = gg->getcontact(uin, 1, 0, NULL);
+ HCONTACT hContact = gg->getcontact(uin, 1, 0, NULL);
if (hContact != NULL)
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
}
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp
index f666244462..4b6d8610df 100644
--- a/protocols/Gadu-Gadu/src/services.cpp
+++ b/protocols/Gadu-Gadu/src/services.cpp
@@ -382,7 +382,7 @@ INT_PTR GGPROTO::get_acc_mgr_gui(WPARAM wParam, LPARAM lParam)
INT_PTR GGPROTO::leavechat(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact)
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);