summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/protocols.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp
index cf754b9ff0..0c0f834562 100644
--- a/src/mir_app/src/protocols.cpp
+++ b/src/mir_app/src/protocols.cpp
@@ -382,10 +382,11 @@ MIR_APP_DLL(int) ProtoServiceExists(const char *szModule, const char *szService)
INT_PTR CallContactServiceInt(MCONTACT hContact, const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam)
{
- auto *ppi = Proto_GetInstance(szModule);
- if (ppi != nullptr) {
- TServiceListItem *item = (TServiceListItem *)bsearch(&szService, serviceItems, _countof(serviceItems), sizeof(serviceItems[0]), CompareServiceItems);
- if (item) {
+ TServiceListItem *item = (TServiceListItem *)bsearch(&szService, serviceItems, _countof(serviceItems), sizeof(serviceItems[0]), CompareServiceItems);
+ if (item) {
+ auto *pa = Proto_GetAccount(szModule);
+ auto *ppi = (pa) ? pa->ppro : 0;
+ if (ppi != nullptr) {
switch (item->id) {
case 1: return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT *)lParam);
case 2: return (INT_PTR)ppi->AddToListByEvent(LOWORD(wParam), HIWORD(wParam), (MEVENT)lParam);