From cb433a48f6562a49695f77ea2e39f8a5592c8822 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 20 Mar 2014 19:29:01 +0000 Subject: disabling metacontacts: fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@8668 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/globals.cpp | 8 ++++---- plugins/Scriver/src/msgs.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'plugins/Scriver') diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index dc06318c27..29ecedf337 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -392,17 +392,17 @@ void ReloadGlobals() static int ackevent(WPARAM wParam, LPARAM lParam) { - ACKDATA *pAck = (ACKDATA *)lParam; + ACKDATA *pAck = (ACKDATA*)lParam; if (!pAck) return 0; if (pAck->type != ACKTYPE_MESSAGE) return 0; - MCONTACT hContact = db_mc_getMeta(pAck->hContact); - if (hContact == NULL) - hContact = pAck->hContact; + MCONTACT hContact = pAck->hContact; MessageSendQueueItem *item = FindSendQueueItem(hContact, (HANDLE)pAck->hProcess); + if (item == NULL) + item = FindSendQueueItem(hContact = db_mc_getMeta(pAck->hContact), (HANDLE)pAck->hProcess); if (item == NULL) return 0; diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index cbd8b96559..7b7bb06af7 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -91,12 +91,15 @@ static INT_PTR ReadMessageCommand(WPARAM wParam, LPARAM lParam) static int MessageEventAdded(WPARAM hContact, LPARAM lParam) { + HANDLE hDbEvent = (HANDLE)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; - db_event_get((HANDLE)lParam, &dbei); + db_event_get(hDbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ)) return 0; HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact); + if (hwnd == NULL) + hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact = db_event_getContact(hDbEvent)); if (hwnd) SendMessage(hwnd, HM_DBEVENTADDED, hContact, lParam); @@ -124,12 +127,12 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) CLISTEVENT cle = { sizeof(cle) }; cle.flags = CLEF_TCHAR; cle.hContact = hContact; - cle.hDbEvent = (HANDLE)lParam; + cle.hDbEvent = hDbEvent; cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; - CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)& cle); + CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); } return 0; } -- cgit v1.2.3