diff options
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;
}
|