summaryrefslogtreecommitdiff
path: root/plugins/MetaContacts/src/meta_services.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MetaContacts/src/meta_services.cpp')
-rw-r--r--plugins/MetaContacts/src/meta_services.cpp14
1 files changed, 6 insertions, 8 deletions
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