summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/globals.cpp8
-rw-r--r--plugins/Scriver/src/msgs.cpp9
-rw-r--r--plugins/TabSRMM/src/mim.cpp12
3 files changed, 18 insertions, 11 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;
}
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index d7fc9f7b20..53dcd6aa31 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -491,12 +491,14 @@ int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM lParam)
* improve the overall responsiveness when receiving messages.
*/
-int CMimAPI::DispatchNewEvent(WPARAM wParam, LPARAM lParam)
+int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM lParam)
{
- if (wParam) {
- HWND h = M.FindWindow(wParam);
+ if (hContact) {
+ HWND h = M.FindWindow(hContact);
+ if (h == NULL)
+ h = M.FindWindow(hContact = db_event_getContact((HANDLE)lParam));
if (h)
- PostMessage(h, HM_DBEVENTADDED, wParam, lParam); // was SENDMESSAGE !!! XXX
+ PostMessage(h, HM_DBEVENTADDED, hContact, lParam); // was SENDMESSAGE !!! XXX
}
return 0;
}
@@ -520,6 +522,8 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM lParam)
db_event_get(hDbEvent, &dbei);
HWND hwnd = M.FindWindow(hContact);
+ if (hwnd == NULL)
+ hwnd = M.FindWindow(hContact = db_event_getContact(hDbEvent));
BOOL isCustomEvent = IsCustomEvent(dbei.eventType);
BOOL isShownCustomEvent = DbEventIsForMsgWindow(&dbei);