From 19642942fd8e581f1de04961a85af87b98b9d9c7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 30 Nov 2012 18:16:36 +0000 Subject: ugh... better a clutch, than a crash git-svn-id: http://svn.miranda-ng.org/main/trunk@2568 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MetaContacts/src/meta_services.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins/MetaContacts/src') diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index 03c154c430..4e491b50f6 100644 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -490,15 +490,16 @@ 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) - if ( CallProtoService(proto, PSR_MESSAGE, (WPARAM)ccs->hContact, (LPARAM)pre) != CALLSERVICE_NOTFOUND) + if (proto) { + char service[256]; + mir_snprintf(service, 256, "%s%s", proto, PSR_MESSAGE); + if (CallService(service, wParam, lParam) != CALLSERVICE_NOTFOUND) return 0; + } } - // otherwise, add event to db directly - DBEVENTINFO dbei = { 0 }; - dbei.cbSize = sizeof(dbei); + DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = META_PROTO; dbei.timestamp = pre->timestamp; dbei.flags = (pre->flags & PREF_CREATEREAD ? DBEF_READ : 0); @@ -509,14 +510,11 @@ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam) if ( pre->flags & PREF_UNICODE ) dbei.cbBlob *= ( sizeof( wchar_t )+1 ); dbei.pBlob = (PBYTE) pre->szMessage; - CallService(MS_DB_EVENT_ADD, (WPARAM) ccs->hContact, (LPARAM)&dbei); - return 0; } - /** Called when an ACK is received. * * Retransmit the ACK sent by a simple contact so that it -- cgit v1.2.3