summaryrefslogtreecommitdiff
path: root/src/modules/protocols
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 /src/modules/protocols
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 'src/modules/protocols')
-rw-r--r--src/modules/protocols/protoaccs.cpp10
-rw-r--r--src/modules/protocols/protochains.cpp14
-rw-r--r--src/modules/protocols/protocols.cpp38
-rw-r--r--src/modules/protocols/protoint.cpp46
4 files changed, 52 insertions, 56 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index ea474771a7..e3ef2977c5 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -199,7 +199,7 @@ void WriteDbAccounts()
/////////////////////////////////////////////////////////////////////////////////////////
static int OnContactDeleted(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact) {
PROTOACCOUNT* pa = Proto_GetAccount(hContact);
if (Proto_IsAccountEnabled(pa) && pa->ppro)
@@ -210,7 +210,7 @@ static int OnContactDeleted(WPARAM wParam, LPARAM lParam)
static int OnDbSettingsChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact) {
PROTOACCOUNT* pa = Proto_GetAccount(hContact);
if (Proto_IsAccountEnabled(pa) && pa->ppro)
@@ -317,7 +317,7 @@ static INT_PTR stub11(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
static INT_PTR stub12(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
{
- return (INT_PTR)ppi->GetCaps(wParam, (HANDLE)lParam);
+ return (INT_PTR)ppi->GetCaps(wParam, (HCONTACT)lParam);
}
static INT_PTR stub13(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
@@ -550,9 +550,9 @@ void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase)
void EraseAccount(const char* pszModuleName)
{
// remove protocol contacts first
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
while (hContact != NULL) {
- HANDLE h1 = hContact;
+ HCONTACT h1 = hContact;
hContact = db_find_next(h1);
char *szProto = GetContactProto(hContact);
diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp
index e14837c18f..cc55405227 100644
--- a/src/modules/protocols/protochains.cpp
+++ b/src/modules/protocols/protochains.cpp
@@ -56,7 +56,7 @@ static int GetProtocolP(MCONTACT hContact, char *szBuf, int cbLen)
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR CallContactService(HANDLE hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
+INT_PTR CallContactService(HCONTACT hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
{
INT_PTR ret;
CCSDATA ccs = { hContact, szProtoService, wParam, lParam };
@@ -161,7 +161,7 @@ static INT_PTR Proto_RecvChain(WPARAM wParam, LPARAM lParam)
return ret;
}
-PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact)
+PROTOACCOUNT* __fastcall Proto_GetAccount(HCONTACT hContact)
{
if (hContact == NULL)
return NULL;
@@ -175,13 +175,13 @@ PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact)
static INT_PTR Proto_GetContactBaseProto(WPARAM wParam, LPARAM)
{
- PROTOACCOUNT *pa = Proto_GetAccount((HANDLE)wParam);
+ PROTOACCOUNT *pa = Proto_GetAccount((HCONTACT)wParam);
return (INT_PTR)(Proto_IsAccountEnabled(pa) ? pa->szModuleName : NULL);
}
static INT_PTR Proto_GetContactBaseAccount(WPARAM wParam, LPARAM)
{
- PROTOACCOUNT *pa = Proto_GetAccount((HANDLE)wParam);
+ PROTOACCOUNT *pa = Proto_GetAccount((HCONTACT)wParam);
return (INT_PTR)(pa ? pa->szModuleName : NULL);
}
@@ -210,14 +210,14 @@ static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam)
if (pd == NULL) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
- db_set_s((HANDLE)wParam, "Protocol", "p", szProto);
+ db_set_s((HCONTACT)wParam, "Protocol", "p", szProto);
return 0;
}
return 1;
}
if (pd->type == PROTOTYPE_PROTOCOL || pd->type == PROTOTYPE_VIRTUAL)
- db_set_s((HANDLE)wParam, "Protocol", "p", szProto);
+ db_set_s((HCONTACT)wParam, "Protocol", "p", szProto);
return 0;
}
@@ -228,7 +228,7 @@ static INT_PTR Proto_RemoveFromContact(WPARAM wParam, LPARAM lParam)
case 0:
return 1;
case -1:
- db_unset((HANDLE)wParam, "Protocol", "p");
+ db_unset((HCONTACT)wParam, "Protocol", "p");
}
return 0;
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 8ef8aadb2d..f2a30976e7 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -203,7 +203,7 @@ static INT_PTR Proto_AuthRecv(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// User Typing Notification services
-static int Proto_ValidTypingContact(HANDLE hContact, char *szProto)
+static int Proto_ValidTypingContact(HCONTACT hContact, char *szProto)
{
if (!hContact || !szProto)
return 0;
@@ -214,11 +214,11 @@ static int Proto_ValidTypingContact(HANDLE hContact, char *szProto)
static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam)
{
if (lParam == PROTOTYPE_SELFTYPING_OFF || lParam == PROTOTYPE_SELFTYPING_ON) {
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (!szProto)
return 0;
- if (Proto_ValidTypingContact((HANDLE)wParam, szProto))
+ if (Proto_ValidTypingContact((HCONTACT)wParam, szProto))
CallProtoServiceInt(NULL,szProto, PSS_USERISTYPING, wParam, lParam);
}
@@ -228,7 +228,7 @@ static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam)
static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
int type = (int)lParam;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (!szProto)
return 0;
@@ -238,7 +238,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
if (type < PROTOTYPE_CONTACTTYPING_OFF)
return 0;
- if (Proto_ValidTypingContact((HANDLE)wParam, szProto))
+ if (Proto_ValidTypingContact((HCONTACT)wParam, szProto))
NotifyEventHooks(hTypeEvent, wParam, lParam);
return 0;
@@ -246,25 +246,21 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
void Proto_SetStatus(const char *szProto, unsigned status)
{
- if (CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)
- {
- TCHAR* awayMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, (WPARAM) status, (LPARAM) szProto);
- if ((INT_PTR)awayMsg == CALLSERVICE_NOTFOUND)
- {
- char* awayMsgA = (char*)CallService(MS_AWAYMSG_GETSTATUSMSG, (WPARAM) status, (LPARAM) szProto);
- if ((INT_PTR)awayMsgA != CALLSERVICE_NOTFOUND)
- {
+ if (CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
+ TCHAR* awayMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, (WPARAM)status, (LPARAM)szProto);
+ if ((INT_PTR)awayMsg == CALLSERVICE_NOTFOUND) {
+ char* awayMsgA = (char*)CallService(MS_AWAYMSG_GETSTATUSMSG, (WPARAM)status, (LPARAM)szProto);
+ if ((INT_PTR)awayMsgA != CALLSERVICE_NOTFOUND) {
awayMsg = mir_a2t(awayMsgA);
mir_free(awayMsgA);
}
}
- if ((INT_PTR)awayMsg != CALLSERVICE_NOTFOUND)
- {
- CallProtoServiceInt(NULL,szProto, PS_SETAWAYMSGT, status, (LPARAM) awayMsg);
+ if ((INT_PTR)awayMsg != CALLSERVICE_NOTFOUND) {
+ CallProtoServiceInt(NULL, szProto, PS_SETAWAYMSGT, status, (LPARAM)awayMsg);
mir_free(awayMsg);
}
}
- CallProtoServiceInt(NULL,szProto, PS_SETSTATUS, status, 0);
+ CallProtoServiceInt(NULL, szProto, PS_SETSTATUS, status, 0);
}
char** __fastcall Proto_FilesMatrixA(wchar_t **files)
@@ -376,7 +372,7 @@ INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wPa
return CallProtoServiceInt(NULL, szModule, szService, wParam, lParam);
}
-INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam)
+INT_PTR CallProtoServiceInt(HCONTACT hContact, const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam)
{
PROTOACCOUNT* pa = Proto_GetAccount(szModule);
if (pa && !pa->bOldProto) {
@@ -446,7 +442,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
else
return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const PROTOCHAR**)&pfr->szFilename);
}
- case 12: return (INT_PTR)ppi->GetCaps(wParam, (HANDLE)lParam);
+ case 12: return (INT_PTR)ppi->GetCaps(wParam, (HCONTACT)lParam);
case 13: return (INT_PTR)Proto_GetIcon(ppi, wParam);
case 14: return (INT_PTR)ppi->GetInfo(hContact, wParam);
case 15:
@@ -473,7 +469,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
case 21: return (INT_PTR)ppi->RecvFile(hContact, (PROTOFILEEVENT*)lParam);
case 22: return (INT_PTR)ppi->RecvMsg(hContact, (PROTORECVEVENT*)lParam);
case 23: return (INT_PTR)ppi->RecvUrl(hContact, (PROTORECVEVENT*)lParam);
- case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (HANDLE*)lParam);
+ case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (HCONTACT*)lParam);
case 25:
if (ppi->m_iVersion > 1) {
TCHAR** files = Proto_FilesMatrixU((char**)lParam);
@@ -494,7 +490,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((char*)lParam));
else
return (INT_PTR)ppi->SetAwayMsg(wParam, (TCHAR*)lParam);
- case 34: return (INT_PTR)ppi->UserIsTyping((HANDLE)wParam, lParam);
+ case 34: return (INT_PTR)ppi->UserIsTyping((HCONTACT)wParam, lParam);
case 35: lstrcpynA((char*)lParam, ppi->m_szModuleName, wParam); return 0;
case 36: return ppi->m_iStatus;
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp
index ba6e40f01e..41b4a7991a 100644
--- a/src/modules/protocols/protoint.cpp
+++ b/src/modules/protocols/protoint.cpp
@@ -57,23 +57,23 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HANDLE)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
}
- int __cdecl Authorize(HANDLE hContact)
+ int __cdecl Authorize(HANDLE hDbEvent)
{
- return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hContact, 0);
+ return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hDbEvent, 0);
}
- int __cdecl AuthDeny(HANDLE hContact, const TCHAR* szReason)
+ int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
{
- return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hContact, (LPARAM)StrConvA(szReason));
+ return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)StrConvA(szReason));
}
- int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT* evt)
+ int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
- int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage)
+ int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage)
{
CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
ccs.lParam = (LPARAM)mir_t2a(szMessage);
@@ -87,7 +87,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HANDLE)ProtoCallService(m_szModuleName, PS_CHANGEINFO, iInfoType, (LPARAM)pInfoData);
}
- HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+ HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
{
CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
@@ -97,13 +97,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer)
+ int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 };
return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
}
- int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
+ int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
{
CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
@@ -125,7 +125,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact)
+ DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact)
{
return (DWORD_PTR)ProtoCallService(m_szModuleName, PS_GETCAPS, type, (LPARAM)hContact);
}
@@ -135,7 +135,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HICON)ProtoCallService(m_szModuleName, PS_LOADICON, iconIndex, 0);
}
- int __cdecl GetInfo(HANDLE hContact, int flags)
+ int __cdecl GetInfo(HCONTACT hContact, int flags)
{
CCSDATA ccs = { hContact, PSS_GETINFO, flags, 0 };
return ProtoCallService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
@@ -176,37 +176,37 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HWND)ProtoCallService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner);
}
- int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT* evt)
+ int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_CONTACTS, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs);
}
- int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
+ int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
return ProtoCallService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs);
}
- int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
+ int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_MESSAGE, 0, (LPARAM)&ccs);
}
- int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT* evt)
+ int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_URL, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_URL, 0, (LPARAM)&ccs);
}
- int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+ int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList };
return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
}
- HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+ HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
{
CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
@@ -218,19 +218,19 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg)
+ int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg)
{
CCSDATA ccs = { hContact, PSS_MESSAGE, flags, (LPARAM)msg };
return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
}
- int __cdecl SendUrl(HANDLE hContact, int flags, const char* url)
+ int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url)
{
CCSDATA ccs = { hContact, PSS_URL, flags, (LPARAM)url };
return (int)ProtoCallService(m_szModuleName, PSS_URL, 0, (LPARAM)&ccs);
}
- int __cdecl SetApparentMode(HANDLE hContact, int mode)
+ int __cdecl SetApparentMode(HCONTACT hContact, int mode)
{
CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, mode, 0 };
return (int)ProtoCallService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs);
@@ -241,13 +241,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
}
- HANDLE __cdecl GetAwayMsg(HANDLE hContact)
+ HANDLE __cdecl GetAwayMsg(HCONTACT hContact)
{
CCSDATA ccs = { hContact, PSS_GETAWAYMSG, 0, 0 };
return (HANDLE)ProtoCallService(m_szModuleName, PSS_GETAWAYMSG, 0, (LPARAM)&ccs);
}
- int __cdecl RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* evt)
+ int __cdecl RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_AWAYMSG, statusMode, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
@@ -258,7 +258,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg));
}
- int __cdecl UserIsTyping(HANDLE hContact, int type)
+ int __cdecl UserIsTyping(HCONTACT hContact, int type)
{
CCSDATA ccs = { hContact, PSS_USERISTYPING, (WPARAM)hContact, type };
return ProtoCallService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs);