summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify/src/popup.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-15 13:45:28 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-15 13:45:28 +0300
commit104ef6721d5a3b4c324ec4f2103a6404ca59837f (patch)
treeca82f7a7e6a285db9d879f85bd6b843ffb919740 /plugins/NewEventNotify/src/popup.cpp
parent71846dbe68eba2268751bebf0e2c2db8029cdd23 (diff)
fixes #3735 (Падение при проверке RSS)
Diffstat (limited to 'plugins/NewEventNotify/src/popup.cpp')
-rw-r--r--plugins/NewEventNotify/src/popup.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 7dadd95c8e..0c3a43d50c 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -51,6 +51,18 @@ static INT_PTR CALLBACK DoDefaultHandling(void *param)
return 0;
}
+static INT_PTR CALLBACK DropPopup(void *param)
+{
+ auto *pdata = (PLUGIN_DATA *)param;
+ if (pdata) {
+ for (auto &it : pdata->events) {
+ Clist_RemoveEvent(pdata->hContact, it);
+ db_event_markRead(pdata->hContact, it);
+ }
+ }
+ return 0;
+}
+
int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA *pdata)
{
if (mask & MASK_OPEN) {
@@ -79,14 +91,8 @@ int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA *pdata)
}
}
- if (mask & MASK_REMOVE) {
- if (pdata) {
- for (auto &it: pdata->events) {
- Clist_RemoveEvent(pdata->hContact, it);
- db_event_markRead(pdata->hContact, it);
- }
- }
- }
+ if (mask & MASK_REMOVE)
+ CallFunctionSync(DropPopup, pdata);
if (mask & MASK_DISMISS) {
KillTimer(hWnd, TIMER_TO_ACTION);