From fc3b3619493714aad949e5d991ac04944cfc6537 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Jun 2015 09:34:14 +0000 Subject: duplicated code - duplicated bugs git-svn-id: http://svn.miranda-ng.org/main/trunk@14284 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/proto_chains.cpp | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'src/mir_app') 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) -- cgit v1.2.3