From 5e9e63c45e37917ffb0acd83832d0d8f99d01883 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Nov 2012 17:38:49 +0000 Subject: new macroses for MS_PROTO_CHAINRECV: ProtoChainRecv, ProtoChainRecvMsg & ProtoChainRecvFile git-svn-id: http://svn.miranda-ng.org/main/trunk@2540 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Alarms/src/alarms.cpp | 6 ------ plugins/FileAsMessage/src/main.cpp | 2 +- plugins/MetaContacts/src/meta_services.cpp | 10 +++------- plugins/MirOTR/MirOTR/src/utils.cpp | 18 ++---------------- 4 files changed, 6 insertions(+), 30 deletions(-) (limited to 'plugins') diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index cc3164809c..aea3791a9c 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -123,12 +123,6 @@ static int PluginMessageReceived(WPARAM wParam,LPARAM lParam) } else mir_sntprintf(buff, SIZEOF(buff), _T("Unknown command issued: \"%s\""), msg); - /* - ppre->szMessage = (char *)Translate(buff); - retval = CallService( MS_PROTO_CHAINRECV, wParam, lParam ); - ppre->szMessage = savedMsg; - */ - ShowPopup(pccsd->hContact, buff); _tcscpy(response, buff); diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 14a905a9b8..197e59309f 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -143,7 +143,7 @@ INT_PTR OnRecvMessage( WPARAM wParam, LPARAM lParam ) PROTORECVEVENT *ppre = ( PROTORECVEVENT * )pccsd->lParam; if(strncmp(ppre->szMessage, szServicePrefix, strlen(szServicePrefix))) - return CallService( MS_PROTO_CHAINRECV, wParam, lParam ); + return CallService(MS_PROTO_CHAINRECV, wParam, lParam); HWND hwnd = WindowList_Find(hFileList, (HANDLE)pccsd->hContact); if(!IsWindow(hwnd)) diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index d48d187d85..c837a7b1c8 100644 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -485,7 +485,6 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) */ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam) { - DBEVENTINFO dbei; CCSDATA *ccs = (CCSDATA *) lParam; PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam; @@ -499,17 +498,14 @@ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam) // use the subcontact's protocol to add the db if possible (AIMOSCAR removes HTML here!) HANDLE most_online = Meta_GetMostOnline(ccs->hContact); char *proto = GetContactProto(most_online); - if (proto) { - char service[256]; - mir_snprintf(service, 256, "%s%s", proto, PSR_MESSAGE); - if (CallService(service, wParam, lParam) != CALLSERVICE_NOTFOUND) + if (proto) + if ( CallProtoService(proto, PSR_MESSAGE, wParam, lParam) != CALLSERVICE_NOTFOUND) return 0; - } } // otherwise, add event to db directly - ZeroMemory(&dbei, sizeof(dbei)); + DBEVENTINFO dbei = { 0 }; dbei.cbSize = sizeof(dbei); dbei.szModule = META_PROTO; dbei.timestamp = pre->timestamp; diff --git a/plugins/MirOTR/MirOTR/src/utils.cpp b/plugins/MirOTR/MirOTR/src/utils.cpp index ea9b55b619..f15987716b 100644 --- a/plugins/MirOTR/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/MirOTR/src/utils.cpp @@ -320,14 +320,8 @@ void ShowMessageInline(const HANDLE hContact, const TCHAR *msg) { char *utf = mir_utf8encodeT(buff); pre.szMessage = utf; pre.flags = PREF_UTF|PREF_BYPASS_OTR; - //CallContactService(hContact, PSR_MESSAGE, 0, (LPARAM)&pre); + ProtoChainRecvMsg(hContact, &pre); - CCSDATA ccs = {0}; - ccs.hContact = hContact; - ccs.szProtoService = PSR_MESSAGE; - ccs.lParam = (LPARAM)⪯ - - CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs); mir_free(utf); } @@ -339,17 +333,9 @@ void ShowMessageInlineUtf(const HANDLE hContact, const char *msg) { pre.timestamp = time(0); pre.szMessage = buff; pre.flags = PREF_UTF|PREF_BYPASS_OTR; - //CallContactService(hContact, PSR_MESSAGE, 0, (LPARAM)&pre); - - CCSDATA ccs = {0}; - ccs.hContact = hContact; - ccs.szProtoService = PSR_MESSAGE; - ccs.lParam = (LPARAM)⪯ - - CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs); + ProtoChainRecvMsg(hContact, &pre); } - void ShowMessageUtf(const HANDLE hContact, const char *msg) { if(options.msg_inline) ShowMessageInlineUtf(hContact, msg); -- cgit v1.2.3