summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-02-11 17:38:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-02-11 17:38:53 +0300
commit39f5fe96a08c5a5de95c28297f5561a9d038fd04 (patch)
treea1f2dfb4661c32f5fb36af27b7ea48bd50d5dc18 /plugins/NewEventNotify/src/main.cpp
parentf34f0f4c72dd6238904f715e1c4c6025559e8821 (diff)
NEN: memory corruption fix
Diffstat (limited to 'plugins/NewEventNotify/src/main.cpp')
-rw-r--r--plugins/NewEventNotify/src/main.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp
index 0d164e9d7f..8039f7bd4b 100644
--- a/plugins/NewEventNotify/src/main.cpp
+++ b/plugins/NewEventNotify/src/main.cpp
@@ -83,21 +83,22 @@ int HookedNewEvent(WPARAM hContact, LPARAM hDbEvent)
//is it an event sent by the user? -> don't show
if (dbe.flags & DBEF_SENT) {
// JK, only message event, do not influence others
- if (g_plugin.bHideSend && NumberPopupData(hContact, EVENTTYPE_MESSAGE) != -1) {
- if (auto *pdata = PU_GetByContact(hContact, EVENTTYPE_MESSAGE))
- PopupAct(pdata->hWnd, MASK_DISMISS, pdata); // JK, only dismiss, i.e. do not kill event (e.g. file transfer)
- }
+ auto *pdata = PU_GetByContact(hContact, EVENTTYPE_MESSAGE);
+ if (g_plugin.bHideSend && pdata)
+ PopupAct(pdata->hWnd, MASK_DISMISS, pdata); // JK, only dismiss, i.e. do not kill event (e.g. file transfer)
return 0;
}
+
// which status do we have, are we allowed to post popups?
// UNDER CONSTRUCTION!!!
CallService(MS_CLIST_GETSTATUSMODE, 0, 0); /// TODO: JK: ????
if (dbe.eventType == EVENTTYPE_MESSAGE && (g_plugin.bMsgWindowCheck && hContact && CheckMsgWnd(hContact)))
return 0;
- //is another popup for this contact already present? -> merge message popups if enabled
- if (dbe.eventType == EVENTTYPE_MESSAGE && (g_plugin.bMergePopup && NumberPopupData(hContact, EVENTTYPE_MESSAGE) != -1))
- PopupUpdate(hContact, hDbEvent);
+ // is another popup for this contact already present? -> merge message popups if enabled
+ auto *pdata = PU_GetByContact(hContact, EVENTTYPE_MESSAGE);
+ if (dbe.eventType == EVENTTYPE_MESSAGE && g_plugin.bMergePopup && pdata)
+ PopupUpdate(*pdata, hDbEvent);
else
PopupShow(hContact, hDbEvent, (UINT)dbe.eventType);