diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-20 19:29:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-20 19:29:01 +0000 |
commit | cb433a48f6562a49695f77ea2e39f8a5592c8822 (patch) | |
tree | 10cd7fc84014b0fc8a298fef9d8638ab3f45368b /plugins/Scriver | |
parent | bb6aa9cc3c864059ac20849cdac413c827fbd5a0 (diff) |
disabling metacontacts: fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@8668 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/src/globals.cpp | 8 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 9 |
2 files changed, 10 insertions, 7 deletions
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,18 +392,18 @@ 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;
HWND hwndSender = item->hwndSender;
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;
}
|