From 104ef6721d5a3b4c324ec4f2103a6404ca59837f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 15 Oct 2023 13:45:28 +0300 Subject: =?UTF-8?q?fixes=20#3735=20(=D0=9F=D0=B0=D0=B4=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BA=D0=B5=20RSS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewEventNotify/src/popup.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'plugins/NewEventNotify/src') 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); -- cgit v1.2.3