summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-20 09:34:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-20 09:34:14 +0000
commitfc3b3619493714aad949e5d991ac04944cfc6537 (patch)
tree63039e9c8b8f3105fb9a09ed5b0f4a7592fb6bc6
parent0e3ebe2dccd658e2f2188c52934e184c570f60f4 (diff)
duplicated code - duplicated bugs
git-svn-id: http://svn.miranda-ng.org/main/trunk@14284 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/mir_app/src/proto_chains.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/mir_app/src/proto_chains.cpp b/src/mir_app/src/proto_chains.cpp
index 60b1e2ad00..b06553c45d 100644
--- a/src/mir_app/src/proto_chains.cpp
+++ b/src/mir_app/src/proto_chains.cpp
@@ -63,7 +63,7 @@ MIR_APP_DLL(INT_PTR) Proto_ChainSend(int iOrder, CCSDATA *ccs)
return 1;
for (int i = iOrder; i < filters.getCount(); i++) {
- if ((ret = CallProtoServiceInt(NULL, filters[i]->szName, ccs->szProtoService, i + 1, iOrder)) != CALLSERVICE_NOTFOUND) {
+ if ((ret = CallProtoServiceInt(NULL, filters[i]->szName, ccs->szProtoService, i + 1, LPARAM(ccs))) != CALLSERVICE_NOTFOUND) {
//chain was started, exit
return ret;
}
@@ -78,7 +78,7 @@ MIR_APP_DLL(INT_PTR) Proto_ChainSend(int iOrder, CCSDATA *ccs)
return 1;
if (pa->bOldProto)
- ret = CallProtoServiceInt(ccs->hContact, szProto, ccs->szProtoService, (WPARAM)(-1), (LPARAM)ccs);
+ ret = CallProtoServiceInt(ccs->hContact, szProto, ccs->szProtoService, -1, (LPARAM)ccs);
else
ret = CallProtoServiceInt(ccs->hContact, szProto, ccs->szProtoService, ccs->wParam, ccs->lParam);
if (ret == CALLSERVICE_NOTFOUND)
@@ -91,32 +91,8 @@ MIR_APP_DLL(INT_PTR) Proto_ChainSend(int iOrder, CCSDATA *ccs)
MIR_APP_DLL(INT_PTR) CallContactService(MCONTACT hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
{
- INT_PTR ret;
CCSDATA ccs = { hContact, szProtoService, wParam, lParam };
-
- for (int i = 0; i < filters.getCount(); i++) {
- if ((ret = CallProtoServiceInt(hContact, filters[i]->szName, szProtoService, i + 1, (LPARAM)&ccs)) != CALLSERVICE_NOTFOUND) {
- //chain was started, exit
- return ret;
- }
- }
-
- char szProto[40];
- if (GetProtocolP(hContact, szProto, sizeof(szProto)))
- return 1;
-
- PROTOACCOUNT *pa = Proto_GetAccount(szProto);
- if (pa == NULL || pa->ppro == NULL)
- return 1;
-
- if (pa->bOldProto)
- ret = CallProtoServiceInt(hContact, szProto, szProtoService, (WPARAM)(-1), (LPARAM)&ccs);
- else
- ret = CallProtoServiceInt(hContact, szProto, szProtoService, wParam, lParam);
- if (ret == CALLSERVICE_NOTFOUND)
- ret = 1;
-
- return ret;
+ return Proto_ChainSend(0, &ccs);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -159,7 +135,7 @@ MIR_APP_DLL(INT_PTR) Proto_ChainRecv(int iOrder, CCSDATA *ccs)
return 1;
if (pa->bOldProto)
- ret = CallProtoServiceInt(ccs->hContact, szProto, ccs->szProtoService, (WPARAM)(-1), (LPARAM)ccs);
+ ret = CallProtoServiceInt(ccs->hContact, szProto, ccs->szProtoService, -1, (LPARAM)ccs);
else
ret = CallProtoServiceInt(ccs->hContact, szProto, ccs->szProtoService, ccs->wParam, ccs->lParam);
if (ret == CALLSERVICE_NOTFOUND)